Nanoseconds

value class Nanoseconds(value: Long) : Comparable<Nanoseconds>

Constructors

Nanoseconds
Link copied to clipboard
common
fun Nanoseconds(value: Int)

Types

Companion
Link copied to clipboard
common
object Companion

Functions

compareTo
Link copied to clipboard
common
open operator override fun compareTo(other: Nanoseconds): Int
div
Link copied to clipboard
common
operator fun div(scalar: Int): Nanoseconds
operator fun div(scalar: Long): Nanoseconds

Returns this duration divided by a scalar value. @throws ArithmeticException if overflow occurs or the scalar is zero

minus
Link copied to clipboard
common
operator fun minus(days: Days): Nanoseconds
operator fun minus(hours: Hours): Nanoseconds
operator fun minus(microseconds: Microseconds): Nanoseconds
operator fun minus(milliseconds: Milliseconds): Nanoseconds
operator fun minus(minutes: Minutes): Nanoseconds
operator fun minus(nanoseconds: Nanoseconds): Nanoseconds
operator fun minus(seconds: Seconds): Nanoseconds
plus
Link copied to clipboard
common
operator fun plus(days: Days): Nanoseconds
operator fun plus(hours: Hours): Nanoseconds
operator fun plus(microseconds: Microseconds): Nanoseconds
operator fun plus(milliseconds: Milliseconds): Nanoseconds
operator fun plus(minutes: Minutes): Nanoseconds
operator fun plus(nanoseconds: Nanoseconds): Nanoseconds
operator fun plus(seconds: Seconds): Nanoseconds
rem
Link copied to clipboard
common
operator fun rem(scalar: Int): Nanoseconds
operator fun rem(scalar: Long): Nanoseconds

Returns the remainder of this duration divided by a scalar value.

times
Link copied to clipboard
common
operator fun times(scalar: Int): Nanoseconds
operator fun times(scalar: Long): Nanoseconds

Multiplies this duration by a scalar value. @throws ArithmeticException if overflow occurs

toComponents
Link copied to clipboard
common
inline fun <T> toComponents(action: (microseconds: Microseconds, nanoseconds: Nanoseconds) -> T): T
inline fun <T> toComponents(action: (milliseconds: Milliseconds, microseconds: Microseconds, nanoseconds: Nanoseconds) -> T): T
inline fun <T> toComponents(action: (seconds: Seconds, milliseconds: Milliseconds, microseconds: Microseconds, nanoseconds: Nanoseconds) -> T): T
inline fun <T> toComponents(action: (minutes: Minutes, seconds: Seconds, milliseconds: Milliseconds, microseconds: Microseconds, nanoseconds: Nanoseconds) -> T): T
inline fun <T> toComponents(action: (hours: Hours, minutes: Minutes, seconds: Seconds, milliseconds: Milliseconds, microseconds: Microseconds, nanoseconds: Nanoseconds) -> T): T
inline fun <T> toComponents(action: (days: Days, hours: Hours, minutes: Minutes, seconds: Seconds, milliseconds: Milliseconds, microseconds: Microseconds, nanoseconds: Nanoseconds) -> T): T
toComponentValues
Link copied to clipboard
common
inline fun <T> toComponentValues(action: (microseconds: Long, nanoseconds: Int) -> T): T
inline fun <T> toComponentValues(action: (milliseconds: Long, microseconds: Int, nanoseconds: Int) -> T): T
inline fun <T> toComponentValues(action: (seconds: Long, milliseconds: Int, microseconds: Int, nanoseconds: Int) -> T): T
inline fun <T> toComponentValues(action: (minutes: Long, seconds: Int, milliseconds: Int, microseconds: Int, nanoseconds: Int) -> T): T
inline fun <T> toComponentValues(action: (hours: Long, minutes: Int, seconds: Int, milliseconds: Int, microseconds: Int, nanoseconds: Int) -> T): T
inline fun <T> toComponentValues(action: (days: Long, hours: Int, minutes: Int, seconds: Int, milliseconds: Int, microseconds: Int, nanoseconds: Int) -> T): T
toDouble
Link copied to clipboard
common
fun toDouble(): Double

Converts this duration to a Double value.

toInt
Link copied to clipboard
common
fun toInt(): Int

Converts this duration to an Int value. @throws ArithmeticException if overflow occurs

toKotlinDuration
Link copied to clipboard
common
fun toKotlinDuration(): Duration

Converts this duration to a kotlin.time.Duration.

toLong
Link copied to clipboard
common
fun toLong(): Long

Converts this duration to a Long value.

toString
Link copied to clipboard
common
open override fun toString(): String

Converts this duration to an ISO-8601 time interval representation.

unaryMinus
Link copied to clipboard
common
operator fun unaryMinus(): Nanoseconds

Negates this duration. @throws ArithmeticException if overflow occurs

Properties

absoluteValue
Link copied to clipboard
common
val absoluteValue: Nanoseconds

The absolute value of this duration. @throws ArithmeticException if overflow occurs

inWholeDays
Link copied to clipboard
common
val inWholeDays: Days

Converts this duration to the number of whole days.

inWholeHours
Link copied to clipboard
common
val inWholeHours: Hours

Converts this duration to the number of whole hours.

inWholeMicroseconds
Link copied to clipboard
common
val inWholeMicroseconds: Microseconds

Converts this duration to the number of whole microseconds.

inWholeMilliseconds
Link copied to clipboard
common
val inWholeMilliseconds: Milliseconds

Converts this duration to the number of whole milliseconds.

inWholeMinutes
Link copied to clipboard
common
val inWholeMinutes: Minutes

Converts this duration to the number of whole minutes.

inWholeSeconds
Link copied to clipboard
common
val inWholeSeconds: Seconds

Converts this duration to the number of whole seconds.

value
Link copied to clipboard
common
val value: Long

The underlying value.

Extensions

asDuration
Link copied to clipboard
common
fun Nanoseconds.asDuration(): Duration
toJavaDuration
Link copied to clipboard
fun Nanoseconds.toJavaDuration(): Duration

Converts this duration to an equivalent Java Duration.

toNSTimeInterval
Link copied to clipboard
darwin
fun Nanoseconds.toNSTimeInterval(): <ERROR CLASS>

Converts this duration to an equivalent NSTimeInterval.