Stopwatch¶
Import: import system;
Read the usage guide for examples and common tasks. This reference lists the public declarations for this part of the library. See Reading API signatures for parameter and result notation.
Stopwatch¶
A high-resolution timer for measuring elapsed time, useful for benchmarking.
constructor¶
Creates a new Stopwatch and starts measuring time immediately.
is_running¶
True while the stopwatch is currently accumulating time.
start¶
Starts or resumes measuring elapsed time.
stop¶
Stops measuring elapsed time.
reset¶
Stops measuring elapsed time and resets the elapsed time to zero.
restart¶
Stops measuring, resets the elapsed time to zero, and starts measuring again.
elapsed_nanos¶
The total elapsed time measured by the current instance, in nanoseconds.
elapsed_ms¶
The total elapsed time measured by the current instance, in milliseconds.