advanceBy

fun advanceBy(duration: Duration)(source)

Moves virtual time forward by duration and runs every task that became due, including those due exactly at the new time (TestCoroutineScheduler.advanceTimeBy leaves those to TestCoroutineScheduler.runCurrent). A zero duration runs the tasks due now. Call it from the test's thread.

Parameters

duration

how far to advance; not negative.

Throws

if duration is negative; the clock is unchanged.