ValueTimeMark

Common
JVM
JS
Native
1.9
inline class ValueTimeMark : ComparableTimeMark
(source)

A specialized kotlin.time.TimeMark returned by TimeSource.Monotonic time source.

This time mark is implemented as an inline value class wrapping a platform-dependent time reading value of the default monotonic time source, thus allowing to avoid additional boxing of that value.

The operations plus and minus are also specialized to return ValueTimeMark type.

This time mark implements ComparableTimeMark and therefore is comparable with other time marks obtained from the same TimeSource.Monotonic time source.

Functions

Common
JVM
JS
Native
1.0

compareTo

Compares this time mark with the other time mark for order.

operator fun compareTo(other: ValueTimeMark): Int
Common
JVM
JS
Native
1.0

elapsedNow

Returns the amount of time passed from this mark measured with the time source from which this mark was taken.

fun elapsedNow(): Duration
Common
JVM
JS
Native
1.0

hasNotPassedNow

Returns false if this time mark has not passed according to the time source from which this mark was taken.

fun hasNotPassedNow(): Boolean
Common
JVM
JS
Native
1.0

hasPassedNow

Returns true if this time mark has passed according to the time source from which this mark was taken.

fun hasPassedNow(): Boolean
Common
JVM
JS
Native
1.0

minus

Returns a time mark on the same time source that is behind this time mark by the specified duration.

fun minus(duration: Duration): ValueTimeMark

Returns the duration elapsed between the other time mark and this time mark.

fun minus(other: ComparableTimeMark): Duration

Returns the duration elapsed between the other time mark obtained from the same TimeSource.Monotonic time source and this time mark.

operator fun minus(other: ValueTimeMark): Duration
Common
JVM
JS
Native
1.0

plus

Returns a time mark on the same time source that is ahead of this time mark by the specified duration.

fun plus(duration: Duration): ValueTimeMark