mirror of
https://github.com/edera-dev/sprout.git
synced 2025-12-19 15:40:16 +00:00
fix(platform/timer): ensure the x86_64 frequency measurement uses wrapping subtraction
This commit is contained in:
@@ -54,7 +54,7 @@ fn measure_frequency(duration: &Duration) -> u64 {
|
|||||||
let start = start();
|
let start = start();
|
||||||
uefi::boot::stall(*duration);
|
uefi::boot::stall(*duration);
|
||||||
let stop = stop();
|
let stop = stop();
|
||||||
let elapsed = (stop - start) as f64;
|
let elapsed = stop.wrapping_sub(start) as f64;
|
||||||
(elapsed / duration.as_secs_f64()) as u64
|
(elapsed / duration.as_secs_f64()) as u64
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user