Timer
Timer objects are created by set_interval or set_timer.
TimerCallback
module-attribute
¶
Type of valid callbacks to be used with timers.
Timer
class
¶
def __init__(
self,
event_target,
interval,
*,
name=None,
callback=None,
repeat=None,
skip=True,
pause=False
):
A class to send timer-based events.
Parameters
Name | Type | Description | Default |
---|---|---|---|
event_target |
MessageTarget
|
The object which will receive the timer events. |
required |
interval |
float
|
The time between timer events, in seconds. |
required |
name |
str | None
|
A name to assign the event (for debugging). |
None
|
callback |
TimerCallback | None
|
A optional callback to invoke when the event is handled. |
None
|
repeat |
int | None
|
The number of times to repeat the timer, or None to repeat forever. |
None
|
skip |
bool
|
Enable skipping of scheduled events that couldn't be sent in time. |
True
|
pause |
bool
|
Start the timer paused. |
False
|