W3cubDocs

/Kotlin

TimeMark

Platform and version requirements: JVM (1.3), JS (1.3), Native (1.3)
@ExperimentalTime 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).

Constructors

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)

<init>

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

TimeMark()

Functions

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)

elapsedNow

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

abstract fun elapsedNow(): Duration
Platform and version requirements: JVM (1.0), JS (1.0), 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
Platform and version requirements: JVM (1.0), JS (1.0), 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
Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)

minus

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

open operator fun minus(duration: Duration): TimeMark
Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)

plus

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

open operator fun plus(duration: Duration): TimeMark

Extension Functions

Platform and version requirements: JVM (1.3), JS (1.3), Native (1.3)

compareTo

operator fun TimeMark.compareTo(other: TimeMark): Int
Platform and version requirements: JVM (1.3), JS (1.3), Native (1.3)

minus

operator fun TimeMark.minus(other: TimeMark): Duration

© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.time/-time-mark/index.html