Time

class Time(source)

Time control helper. See time.

Constructors

Link copied to clipboard

Properties

Link copied to clipboard
val Time.clock: <Error class: unknown class>

Creates a Clock that follows the virtual time in this test.

Link copied to clipboard
val Time.now: <Error class: unknown class>

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

Link copied to clipboard

Accesses the current time inside the test, in milliseconds.

Link copied to clipboard

Accessor for the underlying TestCoroutineScheduler, which controls the current time.

Link copied to clipboard

Access a time source which can be used to measure elapsed time, as controlled with time.

Functions

Link copied to clipboard

Advances the current time by delay.

Link copied to clipboard

Advances the current time by delay.

Link copied to clipboard

Runs all enqueued tasks in the specified order, advancing the virtual time as needed until there are no more scheduled tasks.

Link copied to clipboard
suspend fun Time.delayUntil(instant: <Error class: unknown class>)

Delays until the virtual time reaches instant, executing all enqueued tasks in order.

Delays until the virtual time reaches isoString, formatted as an ISO 8601 timestamp, executing all enqueued tasks in order.

Link copied to clipboard

Runs all enqueued tasks at this moment in the virtual time.

Link copied to clipboard
suspend fun Time.set(instant: <Error class: unknown class>)

Advances the virtual time until it reaches instant.

Advances the virtual time until it reaches isoString, formatted as an ISO 8601 timestamp.