summaryrefslogtreecommitdiffstats
path: root/tokio-timer
diff options
context:
space:
mode:
authorBenjamin Saunders <ben.e.saunders@gmail.com>2019-08-30 10:23:54 -0700
committerCarl Lerche <me@carllerche.com>2019-08-30 10:23:54 -0700
commitd2bd6f5002f806fd2293c8ad156cdf8f756313ec (patch)
treea45a564df7281a50fcb4b319b35c91bac3d722d0 /tokio-timer
parent6a94d2cf4f325b228aab2da9e878c92d19666764 (diff)
timer: Rename `sleep` to `delay_for`, reexport from tokio (#1518)
Diffstat (limited to 'tokio-timer')
-rw-r--r--tokio-timer/src/lib.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/tokio-timer/src/lib.rs b/tokio-timer/src/lib.rs
index 030f14f6..94347666 100644
--- a/tokio-timer/src/lib.rs
+++ b/tokio-timer/src/lib.rs
@@ -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)
}