From 53ccfc1fd694ee70c7a4d1e7af09a856bafb49e5 Mon Sep 17 00:00:00 2001 From: Juan Alvarez Date: Thu, 1 Oct 2020 02:24:33 -0500 Subject: time: introduce `sleep` and `sleep_until` functions (#2826) --- tokio/src/sync/mpsc/bounded.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tokio/src/sync/mpsc') diff --git a/tokio/src/sync/mpsc/bounded.rs b/tokio/src/sync/mpsc/bounded.rs index 5e94e729..38fb753e 100644 --- a/tokio/src/sync/mpsc/bounded.rs +++ b/tokio/src/sync/mpsc/bounded.rs @@ -449,7 +449,7 @@ impl Sender { /// /// ```rust /// use tokio::sync::mpsc; - /// use tokio::time::{delay_for, Duration}; + /// use tokio::time::{sleep, Duration}; /// /// #[tokio::main] /// async fn main() { @@ -466,7 +466,7 @@ impl Sender { /// /// while let Some(i) = rx.recv().await { /// println!("got = {}", i); - /// delay_for(Duration::from_millis(200)).await; + /// sleep(Duration::from_millis(200)).await; /// } /// } /// ``` -- cgit v1.2.3