Duration
A duration of time at nanosecond precision.
For many applications, working with specific units like IntHours or LongSeconds is more efficient and plenty adequate. However, when working with larger durations at sub-second precision, overflow is a very real possibility. Duration is capable of representing fixed, nanosecond-precision durations that span the entire supported time scale, making it more suitable for these use cases.
Types
Functions
isNegative
Link copied to clipboard
isPositive
Link copied to clipboard
minus
Link copied to clipboard
plus
Link copied to clipboard
toComponents
Link copied to clipboard
inline fun <T> toComponents(action: (seconds: LongSeconds, nanoseconds: IntNanoseconds) -> T): T
Content copied to clipboard
inline fun <T> toComponents(action: (minutes: LongMinutes, seconds: IntSeconds, nanoseconds: IntNanoseconds) -> T): T
Content copied to clipboard
inline fun <T> toComponents(action: (hours: LongHours, minutes: IntMinutes, seconds: IntSeconds, nanoseconds: IntNanoseconds) -> T): T
Content copied to clipboard
inline fun <T> toComponents(action: (days: LongDays, hours: IntHours, minutes: IntMinutes, seconds: IntSeconds, nanoseconds: IntNanoseconds) -> T): T
Content copied to clipboard
toKotlinDuration
Link copied to clipboard
truncatedTo
Link copied to clipboard
unaryMinus
Link copied to clipboard
Properties
absoluteValue
Link copied to clipboard
inMicroseconds
Link copied to clipboard
inMilliseconds
Link copied to clipboard
inMinutes
Link copied to clipboard
inNanoseconds
Link copied to clipboard
Converts this duration into LongNanoseconds.
inSeconds
Link copied to clipboard
nanosecondAdjustment
Link copied to clipboard
seconds
Link copied to clipboard