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/src/stream | |
parent | 971ed2c6df9cb3bf3543a9c780662a0b4d1a8d40 (diff) |
time: introduce `sleep` and `sleep_until` functions (#2826)
Diffstat (limited to 'tokio/src/stream')
-rw-r--r-- | tokio/src/stream/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tokio/src/stream/mod.rs b/tokio/src/stream/mod.rs index 59e1482f..ec48392b 100644 --- a/tokio/src/stream/mod.rs +++ b/tokio/src/stream/mod.rs @@ -281,18 +281,18 @@ pub trait StreamExt: Stream { /// tx1.send(2).await.unwrap(); /// /// // Let the other task send values - /// time::delay_for(Duration::from_millis(20)).await; + /// time::sleep(Duration::from_millis(20)).await; /// /// tx1.send(4).await.unwrap(); /// }); /// /// tokio::spawn(async move { /// // Wait for the first task to send values - /// time::delay_for(Duration::from_millis(5)).await; + /// time::sleep(Duration::from_millis(5)).await; /// /// tx2.send(3).await.unwrap(); /// - /// time::delay_for(Duration::from_millis(25)).await; + /// time::sleep(Duration::from_millis(25)).await; /// /// // Send the final value /// tx2.send(5).await.unwrap(); |