Package kotlin.system

System-related utility functions.

Functions

JVM
Native
1.0

exitProcess

Terminates the currently running process.

fun exitProcess(status: Int): Nothing
Native
1.3

getTimeMicros

Gets current system time in microseconds since certain moment in the past, only delta between two subsequent calls makes sense.

fun getTimeMicros(): Long
Native
1.3

getTimeMillis

Gets current system time in milliseconds since certain moment in the past, only delta between two subsequent calls makes sense.

fun getTimeMillis(): Long
Native
1.3

getTimeNanos

Gets current system time in nanoseconds since certain moment in the past, only delta between two subsequent calls makes sense.

fun getTimeNanos(): Long
JVM
Native
1.0

measureNanoTime

Executes the given block and returns elapsed time in nanoseconds.

fun measureNanoTime(block: () -> Unit): Long
Native
1.3

measureTimeMicros

Executes the given block and returns elapsed time in microseconds (Kotlin/Native only).

fun measureTimeMicros(block: () -> Unit): Long
JVM
Native
1.0

measureTimeMillis

Executes the given block and returns elapsed time in milliseconds.

fun measureTimeMillis(block: () -> Unit): Long