Function tokio::time::advance[][src]

pub async fn advance(duration: Duration)
This is supported on crate features time and test-util only.
Expand description

Advance time

Increments the saved Instant::now() value by duration. Subsequent calls to Instant::now() will return the result of the increment.

Panics

Panics if time is not frozen or if called from outside of the Tokio runtime.

Auto-advance

If the time is paused and there is no work to do, the runtime advances time to the next timer. See pause for more details.