advanceTimeBy

Moves the virtual clock of this dispatcher forward by the specified amount, running the scheduled tasks in the meantime.

In contrast with TestCoroutineScope.advanceTimeBy, this function does not run the tasks scheduled at the moment currentTime + delayTimeMillis.

See also

Throws

if passed a negative delay.


Moves the virtual clock of this dispatcher forward by the specified amount, running the scheduled tasks in the meantime.

See also

Throws

if passed a negative delay.

Deprecated (with error)

The name of this function is misleading: it not only advances the time, but also runs the tasks scheduled *at* the ending moment.

Replace with

this.testScheduler.apply { advanceTimeBy(delayTimeMillis); runCurrent() }

Advances the testScheduler by delayTimeMillis and runs the tasks up to that moment (inclusive).

See also