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/time/driver | |
parent | 971ed2c6df9cb3bf3543a9c780662a0b4d1a8d40 (diff) |
time: introduce `sleep` and `sleep_until` functions (#2826)
Diffstat (limited to 'tokio/src/time/driver')
-rw-r--r-- | tokio/src/time/driver/handle.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tokio/src/time/driver/handle.rs b/tokio/src/time/driver/handle.rs index f79f62b4..e9e53e56 100644 --- a/tokio/src/time/driver/handle.rs +++ b/tokio/src/time/driver/handle.rs @@ -25,9 +25,9 @@ impl Handle { /// `Builder::enable_all()` are not included in the builder. /// /// It can also panic whenever a timer is created outside of a Tokio - /// runtime. That is why `rt.block_on(delay_for(...))` will panic, + /// runtime. That is why `rt.block_on(sleep(...))` will panic, /// since the function is executed outside of the runtime. - /// Whereas `rt.block_on(async {delay_for(...).await})` doesn't + /// Whereas `rt.block_on(async {sleep(...).await})` doesn't /// panic. And this is because wrapping the function on an async makes it /// lazy, and so gets executed inside the runtime successfuly without /// panicking. |