Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Update the docs of "pause" to state that time will still advance (…
…#2647) * doc: Update the docs of "pause" to state that time will still advance This was changed in #2059. This had me extremely confused for some time as my timeouts fired immediately, without the wrapped future that were waiting on IO to actually run long enough. I am not sure about the exact wording here but this had me very confused for some time. Deprecating "pause" and giving it a more accurate name may be a good idea as well. ```rust async fn timeout_advances() { time::pause(); timeout(ms(1), async { // Change to 1 and the this future resolve, 2 or // more and the timeout resolves for _ in 0..2 { tokio::task::yield_now().await } }) .await .unwrap(); } ``` * Update tokio/src/time/clock.rs Co-authored-by: Alice Ryhl <alice@ryhl.io> Co-authored-by: Alice Ryhl <alice@ryhl.io>
- Loading branch information