[−][src]Function tokio::time::pause
pub fn pause()
This is supported on
feature="time"
and feature="test-util"
only.Pause time
The current value of Instant::now()
is saved and all subsequent calls
to Instant::now()
until the timer wheel is checked again will return the saved value.
Once the timer wheel is checked, time will immediately advance to the next registered
Delay
. This is useful for running tests that depend on time.
Panics
Panics if time is already frozen or if called from outside of the Tokio runtime.