minus

Common
JVM
JS
Native
1.0
fun minus(duration: Duration): ValueTimeMark
(source)

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

The returned time mark is more early when the duration is positive, and more late when the duration is negative.

If the time mark is adjusted too far in the past or in the future, it may saturate to an infinitely distant time mark. In that case, elapsedNow will return an infinite duration elapsed from such infinitely distant mark.

Exceptions

IllegalArgumentException - an implementation may throw if a positive infinite duration is subtracted from an infinitely distant future time mark or a negative infinite duration is subtracted from an infinitely distant past time mark.

Common
JVM
JS
Native
1.0

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

The returned duration can be infinite if the time marks are far away from each other and the result doesn't fit into Duration type, or if one time mark is infinitely distant, or if both this and other time marks lie infinitely distant on the opposite sides of the time scale.

Two infinitely distant time marks on the same side of the time scale are considered equal and the duration between them is Duration.ZERO.

Note that the other time mark must be obtained from the same time source as this one.

Exceptions

IllegalArgumentException - if time marks were obtained from different time sources.

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

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

The returned duration can be infinite if the time marks are far away from each other and the result doesn't fit into Duration type, or if one time mark is infinitely distant, or if both this and other time marks lie infinitely distant on the opposite sides of the time scale.

Two infinitely distant time marks on the same side of the time scale are considered equal and the duration between them is Duration.ZERO.