Package kotlin.system

System-related utility functions.

Functions

Platform and version requirements: JVM (1.0), Native (1.0)

exitProcess

Terminates the currently running process.

fun exitProcess(status: Int): Nothing
Platform and version requirements: 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
Platform and version requirements: 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
Platform and version requirements: 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
Platform and version requirements: JVM (1.0), Native (1.0)

measureNanoTime

Executes the given block and returns elapsed time in nanoseconds.

fun measureNanoTime(block: () -> Unit): Long
Platform and version requirements: Native (1.3)

measureTimeMicros

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

fun measureTimeMicros(block: () -> Unit): Long
Platform and version requirements: JVM (1.0), Native (1.0)

measureTimeMillis

Executes the given block and returns elapsed time in milliseconds.

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

© 2010–2021 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.system/index.html