10000 [3.11] gh-103417: Fix the scheduler example (GH-111497) (GH-115909) · python/cpython@6324d9b · GitHub
[go: up one dir, main page]

Skip to content

Commit 6324d9b

Browse files
[3.11] gh-103417: Fix the scheduler example (GH-111497) (GH-115909)
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 cb287d3) Co-authored-by: mauricelambert <50479118+mauricelambert@users.noreply.github.com>
1 parent f2b1f6b commit 6324d9b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Doc/library/sched.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ scheduler:
3636
Example::
3737

3838
>>> import sched, time
39-
>>> s = sched.scheduler(time.monotonic, time.sleep)
39+
>>> s = sched.scheduler(time.time, time.sleep)
4040
>>> def print_time(a='default'):
4141
... print("From print_time", time.time(), a)
4242
...

0 commit comments

Comments
 (0)
0