DurationUnit

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
@ExperimentalTime
enum DurationUnit : Enum<DurationUnit>
@ExperimentalTime
enum DurationUnit : Enum<DurationUnit>
typealias DurationUnit = TimeUnit

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
Common
val name: String
name
Link copied to clipboard
JS
val name: String
name
Link copied to clipboard
Native
val name: String
ordinal
Link copied to clipboard
Common
val ordinal: Int
ordinal
Link copied to clipboard
JS
val ordinal: Int
ordinal
Link copied to clipboard
Native
val ordinal: Int