Stopwatch

class Stopwatch(val nanosecondProvider: () -> Double = { PerformanceCounter.nanoseconds })

Constructors

Link copied to clipboard
constructor(nanosecondProvider: () -> Double = { PerformanceCounter.nanoseconds })
constructor(timeProvider: TimeProvider)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard

Pauses the stopwatch, so it can be resumed later

Link copied to clipboard

Restarts the watch, making elapsed start from zero

Link copied to clipboard

When stopped, resumes the stopwatch keeping accumulated elapsed time

Link copied to clipboard

Restarts the watch, making elapsed start from zero

Link copied to clipboard

Stops the watch, keeping elapsed time until restart or resume is called