Package-level declarations

API for representing Duration values and experimental API for measuring time intervals.

API for representing Duration values and experimental API for measuring time intervals.

API for representing Duration values and experimental API for measuring time intervals.

API for representing Duration values and experimental API for measuring time intervals.

API for representing Duration values and experimental API for measuring time intervals.

Types

Link copied to clipboard

An abstract class used to implement time sources that return their readings as Double values in the specified unit.

Since Kotlin 1.3
Link copied to clipboard

An abstract class used to implement time sources that return their readings as Long values in the specified unit.

Since Kotlin 1.3
Link copied to clipboard

A time source that has programmatically updatable readings. It is useful as a predictable source of time in tests.

Since Kotlin 1.3
Link copied to clipboard
data class TimedValue<T>(val value: T, val duration: Duration)

Data class representing a result of executing an action, along with the duration of elapsed time interval.

Since Kotlin 1.3
Link copied to clipboard
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
Link copied to clipboard

A source of time for measuring time intervals.

Since Kotlin 1.3

Properties

Link copied to clipboard

Returns a Duration equal to this Double number of days.

Since Kotlin 1.3

Returns a Duration equal to this Int number of days.

Since Kotlin 1.3

Returns a Duration equal to this Long number of days.

Since Kotlin 1.3
Link copied to clipboard

Returns a Duration equal to this Double number of hours.

Since Kotlin 1.3

Returns a Duration equal to this Int number of hours.

Since Kotlin 1.3

Returns a Duration equal to this Long number of hours.

Since Kotlin 1.3
Link copied to clipboard

Returns a Duration equal to this Double number of microseconds.

Since Kotlin 1.3

Returns a Duration equal to this Int number of microseconds.

Since Kotlin 1.3

Returns a Duration equal to this Long number of microseconds.

Since Kotlin 1.3
Link copied to clipboard

Returns a Duration equal to this Double number of milliseconds.

Since Kotlin 1.3

Returns a Duration equal to this Int number of milliseconds.

Since Kotlin 1.3

Returns a Duration equal to this Long number of milliseconds.

Since Kotlin 1.3
Link copied to clipboard

Returns a Duration equal to this Double number of minutes.

Since Kotlin 1.3

Returns a Duration equal to this Int number of minutes.

Since Kotlin 1.3

Returns a Duration equal to this Long number of minutes.

Since Kotlin 1.3
Link copied to clipboard

Returns a Duration equal to this Double number of nanoseconds.

Since Kotlin 1.3

Returns a Duration equal to this Int number of nanoseconds.

Since Kotlin 1.3

Returns a Duration equal to this Long number of nanoseconds.

Since Kotlin 1.3
Link copied to clipboard

Returns a Duration equal to this Double number of seconds.

Since Kotlin 1.3

Returns a Duration equal to this Int number of seconds.

Since Kotlin 1.3

Returns a Duration equal to this Long number of seconds.

Since Kotlin 1.3

Functions

Link copied to clipboard
inline operator fun TimeMark.compareTo(other: TimeMark): Int
Since Kotlin 1.3
Link copied to clipboard
inline fun measureTime(block: () -> Unit): Duration

Executes the given function block and returns the duration of elapsed time interval.

Since Kotlin 1.3
Link copied to clipboard

Executes the given function block and returns the duration of elapsed time interval.

Since Kotlin 1.3
Link copied to clipboard
inline fun <T> measureTimedValue(block: () -> T): TimedValue<T>

Executes the given function block and returns an instance of TimedValue class, containing both the result of the function execution and the duration of elapsed time interval.

Since Kotlin 1.3
Link copied to clipboard

Executes the given block and returns an instance of TimedValue class, containing both the result of function execution and the duration of elapsed time interval.

Since Kotlin 1.3
Link copied to clipboard
inline operator fun TimeMark.minus(other: TimeMark): Duration
Since Kotlin 1.3