Timer
A simple countdown timer.
Constructor
Timer(duration: float)Parameters
duration: The countdown duration in seconds. Must be greater than 0.
Properties
| Name | Description | Type |
|---|---|---|
done | Whether the timer has completed | bool |
time_remaining | The remaining time on the timer in seconds | float |
elapsed_time | The elapsed time since the timer started in seconds | float |
progress | The progress of the timer as a float between 0.0 and 1.0 | float |
Methods
Start
start() → NoneStart the timer.
Pause
pause() → NonePause the timer.
Resume
resume() → NoneResume the timer.
Reset
reset() → NoneReset the timer to its initial state.