now

val Time.now: <Error class: unknown class>(source)

Access the current virtual time within this test, as an Instant.

Example

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

// …do something…
delay(5000)

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

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

See also

To pass the time to another system.