mirror of
https://github.com/python/cpython.git
synced 2025-09-27 18:59:43 +00:00
[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 cb287d3421
)
Co-authored-by: mauricelambert <50479118+mauricelambert@users.noreply.github.com>
This commit is contained in:
parent
116375eb04
commit
f684e257b1
1 changed files with 1 additions and 1 deletions
|
@ -36,7 +36,7 @@ scheduler:
|
||||||
Example::
|
Example::
|
||||||
|
|
||||||
>>> import sched, time
|
>>> import sched, time
|
||||||
>>> s = sched.scheduler(time.monotonic, time.sleep)
|
>>> s = sched.scheduler(time.time, time.sleep)
|
||||||
>>> def print_time(a='default'):
|
>>> def print_time(a='default'):
|
||||||
... print("From print_time", time.time(), a)
|
... print("From print_time", time.time(), a)
|
||||||
...
|
...
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue