ComparableTimeMark

A TimeMark that can be compared for difference with other time marks obtained from the same TimeSource.WithComparableMarks time source.

Since Kotlin

1.8

Inheritors

Functions

Link copied to clipboard
open operator override fun compareTo(other: ComparableTimeMark): Int

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

Since Kotlin 1.8
Link copied to clipboard
infix inline fun <T> Comparable<T>.compareTo(other: T): Int

Compares this object with the specified object for order. Returns zero if this object is equal to the specified other object, a negative number if it's less than other, or a positive number if it's greater than other.

Since Kotlin 1.6
Link copied to clipboard
abstract fun elapsedNow(): Duration

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

Since Kotlin 1.8
Link copied to clipboard
abstract operator override fun equals(other: Any?): Boolean

Returns true if two time marks from the same time source represent the same moment of time, and false otherwise, including the situation when the time marks were obtained from different time sources.

Since Kotlin 1.8
Link copied to clipboard
abstract override fun hashCode(): Int
Since Kotlin 1.8
Link copied to clipboard

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

Since Kotlin 1.8
Link copied to clipboard
open fun hasPassedNow(): Boolean

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

Since Kotlin 1.8
Link copied to clipboard
abstract operator fun minus(other: ComparableTimeMark): Duration

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

Since Kotlin 1.8
open operator override fun minus(duration: Duration): ComparableTimeMark

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

Since Kotlin 1.8
Link copied to clipboard
abstract operator override fun plus(duration: Duration): ComparableTimeMark

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

Since Kotlin 1.8