3 ms·
The implementation of `sleep` [1] decides the wake up time by when `sleep` is called, rather than when its future is polled. So the first task waits one second,
by claytonwramsey 2y ago
The implementation of `sleep` [1] decides the wake up time by when `sleep` is called, rather than when its future is polled. So the first task waits one second, then the remaining tasks see that they have already passed the wake-up time and so return instantly.
[1]: https://docs.rs/tokio/latest/tokio/time/fn.sleep.html https://docs.rs/tokio/latest/tokio/time/fn.sleep.html
- davidatbu 2y agoThis makes total sense!