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 epoch

fun getTimeMicros(): Long
Native
1.3

getTimeMillis

Gets current system time in milliseconds since epoch

fun getTimeMillis(): Long
Native
1.3

getTimeNanos

Gets current system time in nanoseconds since epoch

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