From f684e257b1499d9399f4fb07f11aa98cad778dd3 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Sun, 25 Feb 2024 13:04:32 +0100 Subject: [PATCH] [3.12] gh-103417: Fix the scheduler example (GH-111497) (GH-115908) Arguments to enterabs() are specified as Unix time. If the scheduler use the time.monotonic timer, the code will take decades to complete. (cherry picked from commit cb287d342139509e03a2dbe5ea2608627fd3a350) Co-authored-by: mauricelambert <50479118+mauricelambert@users.noreply.github.com> --- Doc/library/sched.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/sched.rst b/Doc/library/sched.rst index 01bac5afd0b..4c980dd97f9 100644 --- a/Doc/library/sched.rst +++ b/Doc/library/sched.rst @@ -36,7 +36,7 @@ scheduler: Example:: >>> import sched, time - >>> s = sched.scheduler(time.monotonic, time.sleep) + >>> s = sched.scheduler(time.time, time.sleep) >>> def print_time(a='default'): ... print("From print_time", time.time(), a) ...