time: introduce sleep and sleep_until functions (#2826)

This commit is contained in:
Juan Alvarez
2020-10-01 09:24:33 +02:00
committed by GitHub
parent 971ed2c6df
commit 53ccfc1fd6
31 changed files with 152 additions and 153 deletions
+1 -1
View File
@@ -21,5 +21,5 @@ fn tokio_context_with_another_runtime() {
// Without the `HandleExt.wrap()` there would be a panic because there is
// no timer running, since it would be referencing runtime r1.
let _ = rt1.block_on(rt2.wrap(async move { delay_for(Duration::from_millis(2)).await }));
let _ = rt1.block_on(rt2.wrap(async move { sleep(Duration::from_millis(2)).await }));
}