class sched.scheduler(timefunc=time.monotonic, delayfunc=time.sleep)
The scheduler
class defines a generic interface to scheduling events. 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 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 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 applications.
Changed in version 3.3: timefunc and delayfunc parameters are optional.
Changed in version 3.3: scheduler
class can be safely used in multi-threaded environments.
Please login to continue.