Timestamp

data class Timestamp : Comparable<Timestamp>
kotlin.Any
   ↳ androidx.ui.core.Timestamp

A single point in time expressed in nanoseconds. Compare to Duration. Timestamp permits arithmetic between absolute timestamps from the same time base yielding Duration where deltas from two timestamps are involved.

The time base of any given Timestamp is defined by the context where the Timestamp was obtained.

Summary

Public constructors

<init>(nanoseconds: Long)

A single point in time expressed in nanoseconds.

Public methods

Int

operator Timestamp
minus(duration: Duration)

Subtracts a Duration from this timestamp and returns the result.

operator Duration
minus(other: Timestamp)

Returns the Duration between this timestamp and another.

operator Timestamp
plus(duration: Duration)

Adds a Duration to this timestamp and returns the result.

Properties

Long

Public constructors

<init>

Timestamp(nanoseconds: Long)

A single point in time expressed in nanoseconds. Compare to Duration. Timestamp permits arithmetic between absolute timestamps from the same time base yielding Duration where deltas from two timestamps are involved.

The time base of any given Timestamp is defined by the context where the Timestamp was obtained.

Public methods

compareTo

fun compareTo(other: Timestamp): Int

minus

operator fun minus(duration: Duration): Timestamp

Subtracts a Duration from this timestamp and returns the result.

minus

operator fun minus(other: Timestamp): Duration

Returns the Duration between this timestamp and another.

plus

operator fun plus(duration: Duration): Timestamp

Adds a Duration to this timestamp and returns the result.

Properties

nanoseconds

val nanoseconds: Long