TimeMark

abstract class TimeMark

Represents a time point notched on a particular TimeSource. Remains bound to the time source it was taken from and allows querying for the duration of time elapsed from that point (see the function elapsedNow).

Since Kotlin

1.3

Constructors

TimeMark
Link copied to clipboard
fun TimeMark()

Functions

elapsedNow
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.

hasNotPassedNow
Link copied to clipboard
fun hasNotPassedNow(): Boolean

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

hasPassedNow
Link copied to clipboard
fun hasPassedNow(): Boolean

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

minus
Link copied to clipboard
open operator fun minus(duration: Duration): TimeMark

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

plus
Link copied to clipboard
open operator fun plus(duration: Duration): TimeMark

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

Extensions

compareTo
Link copied to clipboard
inline operator fun TimeMark.compareTo(other: TimeMark): Int
minus
Link copied to clipboard
inline operator fun TimeMark.minus(other: TimeMark): Duration