We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 14c0c0b commit 37bf4bfCopy full SHA for 37bf4bf
1 file changed
os/src/timer.rs
@@ -25,12 +25,12 @@ pub fn get_time() -> usize {
25
26
/// Get the current time in milliseconds
27
pub fn get_time_ms() -> usize {
28
- time::read() / (CLOCK_FREQ / MSEC_PER_SEC)
+ time::read() * MSEC_PER_SEC / CLOCK_FREQ
29
}
30
31
/// get current time in microseconds
32
pub fn get_time_us() -> usize {
33
- time::read() / (CLOCK_FREQ / MICRO_PER_SEC)
+ time::read() * MICRO_PER_SEC / CLOCK_FREQ
34
35
36
/// Set the next timer interrupt
0 commit comments