nanoseconds

fun nanoseconds(value: Int): Duration
fun nanoseconds(value: Long): Duration

Returns a Duration representing the specified value number of nanoseconds.

Since Kotlin

1.5

fun nanoseconds(value: Double): Duration

Returns a Duration representing the specified value number of nanoseconds.

Since Kotlin

1.5

Throws

if the provided Doublevalue is NaN.