MonoClock

Common
JS
1.3
object MonoClock : Clock
JVM
Native
1.3
object MonoClock : AbstractLongClock, Clock

The most precise clock available in the platform.

The clock returns its readings from a source of monotonic time when it is available in a target platform, and resorts to a non-monotonic time source otherwise.

Functions

JS
1.1

markNow

fun markNow(): ClockMark
JVM
Native
1.0

read

fun read(): Long
JVM
Native
1.0

toString

Returns a string representation of the object.

fun toString(): String

Extension Functions

Common
JVM
JS
Native
1.3

measureTime

Executes the given function block and returns the duration of elapsed time interval.

fun Clock.measureTime(block: () -> Unit): Duration
Common
JVM
JS
Native
1.3

measureTimedValue

Executes the given block and returns an instance of TimedValue class, containing both the result of function execution and the duration of elapsed time interval.

fun <T> Clock.measureTimedValue(
    block: () -> T
): TimedValue<T>