time: A way to advance time manually #2777
Labels
A-tokio
Area: The main tokio crate
C-question
User questions that are neither feature requests nor bug reports
M-time
Module: tokio/time
Is your feature request related to a problem? Please describe.
I am trying to write unit tests for code which involves running things throughout time in a task. I saw the
tokio::time::{pause, advance}
functions and thought those would work. I thought I could do something like thisBut since #2059, the
yield_now
will cause the executor to park the thread and the time driver advances time, so the thing happens early.Describe the solution you'd like
A way to actually pause time and advance manually.
The text was updated successfully, but these errors were encountered: