WithComparableMarks

A TimeSource that returns time marks that can be compared for difference with each other.

Since Kotlin

1.9

Inheritors

Functions

Link copied to clipboard
@JvmName(name = "fromTimeSource")
fun TimeSource.asClock(origin: Instant): Clock

Creates a Clock that uses the time mark at the moment of creation to determine how far the current moment is from the origin.

Since Kotlin 2.3
Link copied to clipboard
abstract override fun markNow(): ComparableTimeMark

Marks a point in time on this time source.

Since Kotlin 1.9
Link copied to clipboard
inline fun TimeSource.measureTime(block: () -> Unit): Duration

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

Since Kotlin 1.9
Link copied to clipboard
inline fun <T> TimeSource.measureTimedValue(block: () -> T): TimedValue<T>

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.

Since Kotlin 1.9