timer: Rename sleep to delay_for, reexport from tokio (#1518)

This commit is contained in:
Benjamin Saunders
2019-08-30 10:23:54 -07:00
committed by Carl Lerche
parent 6a94d2cf4f
commit d2bd6f5002
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -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)
}