mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
Issue #16642: sched.scheduler timefunc initial default is time.monotonic.
Patch by Ramchandra Apte
This commit is contained in:
parent
f96b2b03bb
commit
adecf3f66f
3 changed files with 7 additions and 2 deletions
|
@ -14,12 +14,13 @@
|
||||||
The :mod:`sched` module defines a class which implements a general purpose event
|
The :mod:`sched` module defines a class which implements a general purpose event
|
||||||
scheduler:
|
scheduler:
|
||||||
|
|
||||||
.. class:: scheduler(timefunc=time.time, delayfunc=time.sleep)
|
.. class:: scheduler(timefunc=time.monotonic, delayfunc=time.sleep)
|
||||||
|
|
||||||
The :class:`scheduler` class defines a generic interface to scheduling events.
|
The :class:`scheduler` class defines a generic interface to scheduling events.
|
||||||
It needs two functions to actually deal with the "outside world" --- *timefunc*
|
It needs two functions to actually deal with the "outside world" --- *timefunc*
|
||||||
should be callable without arguments, and return a number (the "time", in any
|
should be callable without arguments, and return a number (the "time", in any
|
||||||
units whatsoever). The *delayfunc* function should be callable with one
|
units whatsoever). If time.monotonic is not available, the *timefunc* default
|
||||||
|
is time.time instead. The *delayfunc* function should be callable with one
|
||||||
argument, compatible with the output of *timefunc*, and should delay that many
|
argument, compatible with the output of *timefunc*, and should delay that many
|
||||||
time units. *delayfunc* will also be called with the argument ``0`` after each
|
time units. *delayfunc* will also be called with the argument ``0`` after each
|
||||||
event is run to allow other threads an opportunity to run in multi-threaded
|
event is run to allow other threads an opportunity to run in multi-threaded
|
||||||
|
|
|
@ -44,6 +44,7 @@ Jérémy Anger
|
||||||
Ankur Ankan
|
Ankur Ankan
|
||||||
Jon Anglin
|
Jon Anglin
|
||||||
Heidi Annexstad
|
Heidi Annexstad
|
||||||
|
Ramchandra Apte
|
||||||
Éric Araujo
|
Éric Araujo
|
||||||
Alicia Arlen
|
Alicia Arlen
|
||||||
Jeffrey Armstrong
|
Jeffrey Armstrong
|
||||||
|
|
|
@ -802,6 +802,9 @@ Tools/Demos
|
||||||
Documentation
|
Documentation
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
|
- Issue #16642: sched.scheduler timefunc initial default is time.monotonic.
|
||||||
|
Patch by Ramchandra Apte
|
||||||
|
|
||||||
- Issue #15465: Document the versioning macros in the C API docs rather than
|
- Issue #15465: Document the versioning macros in the C API docs rather than
|
||||||
the standard library docs. Patch by Kushal Das.
|
the standard library docs. Patch by Kushal Das.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue