W3cubDocs

/Kotlin

toDuration

Platform and version requirements: JVM (1.3), JS (1.3), Native (1.3)
@ExperimentalTime fun Int.toDuration(
    unit: DurationUnit
): Duration

Returns a Duration equal to this Int number of the specified unit.

Platform and version requirements: JVM (1.3), JS (1.3), Native (1.3)
@ExperimentalTime fun Long.toDuration(
    unit: DurationUnit
): Duration

Returns a Duration equal to this Long number of the specified unit.

Platform and version requirements: JVM (1.3), JS (1.3), Native (1.3)
@ExperimentalTime fun Double.toDuration(
    unit: DurationUnit
): Duration

Returns a Duration equal to this Double number of the specified unit.

© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.time/to-duration.html