Adjusted behavior.

This commit is contained in:
Frostie314159 2024-03-22 08:50:56 +01:00
parent 7efe8e0005
commit 2ea1040e07
No known key found for this signature in database
GPG Key ID: 0C2C22C244C8223F

View File

@ -190,10 +190,10 @@ impl Ticker {
self.expires_at = Instant::now() + self.duration;
}
/// Reset the ticker to fire for the next time on the deadline.
/// Reset the ticker at the deadline.
/// If the deadline is in the past, the ticker will fire instantly.
pub fn reset_at(&mut self, deadline: Instant) {
self.expires_at = deadline;
self.expires_at = deadline + self.duration;
}
/// Resets the ticker, after the specified duration has passed.