Timer — Timer handle¶
- class pyuv.Timer(loop)¶
- Parameters:
loop (
Loop) – loop object where this handle runs (accessible throughTimer.loop).
A
Timerhandle will run the supplied callback after the specified amount of seconds.- start(callback, timeout, repeat)¶
- Parameters:
callback (callable) – Function that will be called when the
Timerhandle is run by the event loop.timeout (float) – The
Timerwill start after the specified amount of time.repeat (float) – The
Timerwill run again after the specified amount of time.
Start the
Timerhandle.Callback signature:
callback(timer_handle).
- stop()¶
Stop the
Timerhandle.
- again()¶
Stop the
Timer, and if it is repeating restart it using the repeat value as the timeout.
- repeat¶
Get/set the repeat value. Note that if the repeat value is set from a timer callback it does not immediately take effect. If the timer was non-repeating before, it will have been stopped. If it was repeating, then the old repeat value will have been used to schedule the next timeout.