Fix time calculation
Use unwrap_or_get to avoid checking time when not necessary
This commit is contained in:
parent
3c2daf0d32
commit
5e6ee59ecd
1 changed files with 1 additions and 1 deletions
|
@ -90,7 +90,7 @@ impl TimeDriver {
|
|||
// Ensure we don't overflow
|
||||
let until = zero
|
||||
.checked_add(StdDuration::from_micros(next_alarm))
|
||||
.unwrap_or(zero + StdDuration::from_secs(1));
|
||||
.unwrap_or_else(|| StdInstant::now() + StdDuration::from_secs(1));
|
||||
|
||||
unsafe { DRIVER.signaler.as_ref() }.wait_until(until);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue