mirror of
https://github.com/edera-dev/sprout.git
synced 2025-12-19 17:30:17 +00:00
fix(platform/timer): use wrapping subtraction to measure duration of a timer
This commit is contained in:
@@ -83,7 +83,7 @@ impl PlatformTimer {
|
||||
|
||||
/// Measure the elapsed duration since the timer was started.
|
||||
pub fn elapsed_since_start(&self) -> Duration {
|
||||
let duration = arch_ticks() - self.start;
|
||||
let duration = arch_ticks().wrapping_sub(self.start);
|
||||
self.frequency.duration(duration)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user