mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-27 00:00:12 +02:00
timer: delay_for should use tokio_timer::clock::now (#1572)
This commit is contained in:
committed by
Carl Lerche
parent
9d5af20bcf
commit
34e388619f
@@ -40,7 +40,7 @@ impl Interval {
|
||||
|
||||
/// Creates new `Interval` that yields with interval of `duration`.
|
||||
///
|
||||
/// The function is shortcut for `Interval::new(Instant::now() + duration, duration)`.
|
||||
/// The function is shortcut for `Interval::new(tokio_timer::clock::now() + duration, duration)`.
|
||||
///
|
||||
/// The `duration` argument must be a non-zero duration.
|
||||
///
|
||||
|
||||
@@ -70,9 +70,9 @@ pub fn delay(deadline: Instant) -> Delay {
|
||||
|
||||
/// Create a Future that completes in `duration` from now.
|
||||
///
|
||||
/// Equivalent to `delay(Instant::now() + duration)`. Analogous to `std::thread::sleep`.
|
||||
/// Equivalent to `delay(tokio_timer::clock::now() + duration)`. Analogous to `std::thread::sleep`.
|
||||
pub fn delay_for(duration: Duration) -> Delay {
|
||||
delay(Instant::now() + duration)
|
||||
delay(clock::now() + duration)
|
||||
}
|
||||
|
||||
// ===== Internal utils =====
|
||||
|
||||
Reference in New Issue
Block a user