measureTime
Platform and version requirements: JVM (1.9), JS (1.9), Native (1.9)
inline fun measureTime(block: () -> Unit): Duration
Executes the given function block and returns the duration of elapsed time interval.
The elapsed time is measured with TimeSource.Monotonic.
Platform and version requirements: JVM (1.9), JS (1.9), Native (1.9)
inline fun TimeSource.measureTime( block: () -> Unit ): Duration
Executes the given function block and returns the duration of elapsed time interval.
The elapsed time is measured with the specified this TimeSource instance.
Platform and version requirements: JVM (1.9), JS (1.9), Native (1.9)
inline fun Monotonic.measureTime(block: () -> Unit): Duration
Executes the given function block and returns the duration of elapsed time interval.
The elapsed time is measured with the specified this TimeSource.Monotonic instance.
© 2010–2023 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.time/measure-time.html