Skip to content

Commit d23f8ee

Browse files
committed
when for delay
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
1 parent 9996569 commit d23f8ee

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/delay.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ impl Delay {
4141
Delay::new_handle(Instant::now() + dur, Default::default())
4242
}
4343

44+
/// Return the `Instant` when this delay will fire.
45+
#[inline]
46+
pub fn when(&self, timeout: &Delay) -> Instant {
47+
timeout.when
48+
}
49+
4450
/// Creates a new future which will fire at the time specified by `at`.
4551
///
4652
/// The returned instance of `Delay` will be bound to the timer specified by

0 commit comments

Comments
 (0)