DurationUnit

expect enum DurationUnit : Enum<DurationUnit>

The list of possible time measurement units, in which a duration can be expressed.

The smallest time unit is NANOSECONDS and the largest is DAYS, which corresponds to exactly 24 HOURS.

Since Kotlin

1.3
actual typealias DurationUnit = TimeUnit
@ExperimentalTime
actual enum DurationUnit : Enum<DurationUnit>
@ExperimentalTime
actual enum DurationUnit : Enum<DurationUnit>

Entries

NANOSECONDS
Link copied to clipboard

Time unit representing one nanosecond, which is 1/1000 of a microsecond.

Time unit representing one nanosecond, which is 1/1000 of a microsecond.

Time unit representing one nanosecond, which is 1/1000 of a microsecond.

MICROSECONDS
Link copied to clipboard

Time unit representing one microsecond, which is 1/1000 of a millisecond.

MICROSECONDS(1000.0)

Time unit representing one microsecond, which is 1/1000 of a millisecond.

MICROSECONDS(1000.0)

Time unit representing one microsecond, which is 1/1000 of a millisecond.

MILLISECONDS
Link copied to clipboard

Time unit representing one millisecond, which is 1/1000 of a second.

MILLISECONDS(1000000.0)

Time unit representing one millisecond, which is 1/1000 of a second.

MILLISECONDS(1000000.0)

Time unit representing one millisecond, which is 1/1000 of a second.

SECONDS
Link copied to clipboard

Time unit representing one second.

SECONDS(1.0E9)

Time unit representing one second.

SECONDS(1.0E9)

Time unit representing one second.

MINUTES
Link copied to clipboard

Time unit representing one minute.

MINUTES(6.0E10)

Time unit representing one minute.

MINUTES(6.0E10)

Time unit representing one minute.

HOURS
Link copied to clipboard

Time unit representing one hour.

HOURS(3.6E12)

Time unit representing one hour.

HOURS(3.6E12)

Time unit representing one hour.

DAYS
Link copied to clipboard

Time unit representing one day, which is always equal to 24 hours.

DAYS(8.64E13)

Time unit representing one day, which is always equal to 24 hours.

DAYS(8.64E13)

Time unit representing one day, which is always equal to 24 hours.

Properties

name
Link copied to clipboard
val name: String
name
Link copied to clipboard
val name: String
name
Link copied to clipboard
val name: String
ordinal
Link copied to clipboard
val ordinal: Int
ordinal
Link copied to clipboard
val ordinal: Int
ordinal
Link copied to clipboard
val ordinal: Int