Timer
A simple timer for measuring elapsed time.
Usage
Timer()Parameters
label: str-
A label for this timer instance.
auto_start: bool = False-
Whether to start timing immediately.
Methods
| Name | Description |
|---|---|
| reset() | Reset the timer to zero. |
| start() | Start the timer. |
| stop() | Stop the timer and return elapsed time. |
reset()
Reset the timer to zero.
Usage
reset()start()
Start the timer.
Usage
start()Raises
RuntimeError-
If the timer is already running.
stop()
Stop the timer and return elapsed time.
Usage
stop()Returns
float-
The elapsed time in seconds.