measureTime

inline fun measureTime(block: () -> Unit): Duration(source)

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

The elapsed time is measured with TimeSource.Monotonic.

Since Kotlin

1.3

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

The elapsed time is measured with the specified this TimeSource instance.

Since Kotlin

1.3

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.

Since Kotlin

1.7