Class StopWatch
A timer class which lets you start timing and then check the amount of time elapsed.
Declaration
class StopWatch(object)
source linkDocumentation
Methods
▶ def __init__(self, desc=None) Initializes the StopWatch but does not start it.
- desc:
A string description to print when stringifying.
▷ def hms_str(self) @property Returns the stringified value of the stopwatch in HH:MM:SS.msec format
@property
def hms_str(self)
▷ def is_elapsed_ms(self, duration_ms) Returns True if this timer has measured at least ``duration_ms`` milliseconds. Otherwise, returns False. If ``duration_ms`` is None, returns False.
▷ def is_elapsed_secs(self, duration_secs) Returns True if this timer has measured at least ``duration_secs`` seconds. Otherwise, returns False. If ``duration_secs`` is None, returns False.
▷ def is_started(self) @property True if the StopWatch has been started but not stoped (i.e., it's currently running), false otherwise.
@property
def is_started(self)
▷ def reset(self) Resets the timer and leaves it stopped.
▷ def restart(self) Resets and then starts the timer.
▶ def start(self) Starts the timer. If the timer is already running, resets it.
▷ def stop(self) Stops the timer. The time value of this Stopwatch is paused and will not continue increasing.
▷ def value_hms(self) @property Returns this StopWatch's elapsed time as a tuple ``(hours, minutes, seconds, milliseconds)``.
@property
def value_hms(self)
▷ def value_ms(self) @property Returns the value of the stopwatch in milliseconds
@property
def value_ms(self)
▷ def value_secs(self) @property Returns the value of the stopwatch in seconds
@property
def value_secs(self)
Reexports