mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-25 00:00:18 +02:00
timer: Rename sleep to delay_for, reexport from tokio (#1518)
This commit is contained in:
committed by
Carl Lerche
parent
6a94d2cf4f
commit
d2bd6f5002
@@ -64,7 +64,9 @@ pub fn delay(deadline: Instant) -> Delay {
|
||||
}
|
||||
|
||||
/// Create a Future that completes in `duration` from now.
|
||||
pub fn sleep(duration: Duration) -> Delay {
|
||||
///
|
||||
/// Equivalent to `delay(Instant::now() + duration)`. Analogous to `std::thread::sleep`.
|
||||
pub fn delay_for(duration: Duration) -> Delay {
|
||||
delay(Instant::now() + duration)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user