Duration

data class Duration : Parcelable

Describes the time duration of an action.

Parameters

durationMillis

Time duration in milliseconds.

Important: This is a Public Preview API. It may be changed or removed at any time.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
operator fun compareTo(other: Duration): Int
Link copied to clipboard
abstract fun describeContents(): Int
Link copied to clipboard
operator fun div(scale: Int): Duration

Returns a Duration whose value is this duration value divided by the given scale number.

Link copied to clipboard
fun inDays(): Long

Returns the value of this Duration expressed as a Long number of days.

Link copied to clipboard
fun inHours(): Long

Returns the value of this Duration expressed as a Long number of hours.

Link copied to clipboard
fun inMilliseconds(): Long

Returns the value of this Duration expressed as a Long number of milliseconds.

Link copied to clipboard
fun inMinutes(): Long

Returns the value of this Duration expressed as a Long number of minutes.

Link copied to clipboard
fun inNanos(): Long

Returns the value of this Duration expressed as a Long number of nanoseconds.

Link copied to clipboard
fun inSeconds(): Long

Returns the value of this Duration expressed as a Long number of seconds.

Link copied to clipboard
operator fun minus(other: Duration): Duration

Returns a Duration whose value is the difference between this and other duration values.

Link copied to clipboard
operator fun plus(other: Duration): Duration

Returns a Duration whose value is the sum of this and other duration values.

Link copied to clipboard
operator fun rem(other: Duration): Duration

Returns a Duration whose value is remainder of truncating division of this Duration.durationMillis by the other.

Link copied to clipboard
operator fun times(scale: Double): Duration
operator fun times(scale: Int): Duration

Returns a Duration whose value is this duration value multiplied by the given scale number.

Link copied to clipboard
abstract fun writeToParcel(p0: Parcel, p1: Int)