mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-03 00:00:05 +02:00
time: introduce sleep and sleep_until functions (#2826)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#![warn(rust_2018_idioms)]
|
||||
|
||||
use tokio::time::{delay_until, Duration, Instant};
|
||||
use tokio::time::{sleep_until, Duration, Instant};
|
||||
use tokio_test::block_on;
|
||||
|
||||
#[test]
|
||||
@@ -22,6 +22,6 @@ fn test_delay() {
|
||||
let deadline = Instant::now() + Duration::from_millis(100);
|
||||
|
||||
block_on(async {
|
||||
delay_until(deadline).await;
|
||||
sleep_until(deadline).await;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user