Skip to content

Compatibility with KotlinX.Datetimeopensavvy.prepared.compat.kotlinx.datetimedelayUntil

delayUntil

@ExperimentalCoroutinesApi
suspend fun Time.delayUntil(instant: Instant)

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

delayUntil is useful to artificially trigger time-dependent algorithms. To set the initial time at the start of the test, use set.

@ExperimentalCoroutinesApi
suspend fun Time.delayUntil(isoString: String)

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

delayUntil is useful to artificially trigger time-dependent algorithms. To set the initial time at the start of the test, use set.

See also

  • setSet the current time

  • nowAccess the current time