nowMillis

Accesses the current time inside the test, in milliseconds.

Example

test("Using the virtual time") {
val initial = time.nowMillis

// …do something…
delay(5000)

check(time.nowMillis == initial + 5000)
}

For the specific use-case of measuring elapsed time, see Time.source.

See also

Access the current time as an Instant.