class
Stopwatch

A simple stopwatch interface to measure elapsed time.

Properties

int frequency
read-only
Frequency of the elapsed counter in Hz.
int elapsedTicks
read-only
Returns the elapsed number of clock ticks since calling [start] while the [Stopwatch] is running.
Duration elapsed
read-only
Returns the [elapsedTicks] counter converted to a [Duration].
int elapsedMicroseconds
read-only
Returns the [elapsedTicks] counter converted to microseconds.
int elapsedMilliseconds
read-only
Returns the [elapsedTicks] counter converted to milliseconds.
bool isRunning
read-only
Returns wether the [StopWatch] is currently running.

Constructors

Stopwatch()
Creates a Stopwatch in stopped state with a zero elapsed count.

Methods

start() → void
Starts the Stopwatch.
stop() → void
Stops the Stopwatch.
reset() → void
Resets the elapsed count to zero.