toLong

Common
JVM
JS
Native
1.0
fun toLong(unit: DurationUnit): Long

Returns the value of this duration expressed as a Long number of the specified unit.

If the result doesn't fit in the range of Long type, it is coerced into that range:

An infinite duration value is converted either to Long.MAX_VALUE or Long.MIN_VALUE depending on its sign.