TimeSource
A source of time for measuring time intervals.
The only operation provided by the time source is markNow. It returns a TimeMark, which can be used to query the elapsed time later.
In general, TimeSource may not be monotonic, which may result in a negative duration returned from TimeMark.elapsedNow for a TimeMark obtained from a particular TimeSource. The monotonicity is guaranteed for TimeSource.Monotonic.
Since Kotlin
1.9See also
Inheritors
Types
The most precise time source available in the platform.
A TimeSource that returns time marks that can be compared for difference with each other.
Functions
Creates a Clock that uses the time mark at the moment of creation to determine how far the current moment is from the origin.
Executes the given function block and returns the duration of the elapsed time interval.
Executes the given function block and returns an instance of TimedValue class, containing both the result of function execution and the duration of the elapsed time interval.