diff options
author | Juan Alvarez <j@yabit.io> | 2020-10-01 02:24:33 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-01 09:24:33 +0200 |
commit | 53ccfc1fd694ee70c7a4d1e7af09a856bafb49e5 (patch) | |
tree | 66f0b4c089729616b57bbb69b0a6351b45a0c898 /tokio/tests/macros_select.rs | |
parent | 971ed2c6df9cb3bf3543a9c780662a0b4d1a8d40 (diff) |
time: introduce `sleep` and `sleep_until` functions (#2826)
Diffstat (limited to 'tokio/tests/macros_select.rs')
-rw-r--r-- | tokio/tests/macros_select.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tokio/tests/macros_select.rs b/tokio/tests/macros_select.rs index a6c8f8f5..f971409b 100644 --- a/tokio/tests/macros_select.rs +++ b/tokio/tests/macros_select.rs @@ -359,7 +359,7 @@ async fn join_with_select() { async fn use_future_in_if_condition() { use tokio::time::{self, Duration}; - let mut delay = time::delay_for(Duration::from_millis(50)); + let mut delay = time::sleep(Duration::from_millis(50)); tokio::select! { _ = &mut delay, if !delay.is_elapsed() => { @@ -459,7 +459,7 @@ async fn async_noop() {} async fn async_never() -> ! { use tokio::time::Duration; loop { - tokio::time::delay_for(Duration::from_millis(10)).await; + tokio::time::sleep(Duration::from_millis(10)).await; } } |