We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 437f128 commit 66eeff8Copy full SHA for 66eeff8
os/src/timer.rs
@@ -17,12 +17,12 @@ pub fn get_time() -> usize {
17
18
/// get current time in milliseconds
19
pub fn get_time_ms() -> usize {
20
- time::read() / (CLOCK_FREQ / MSEC_PER_SEC)
+ time::read() * MSEC_PER_SEC / CLOCK_FREQ
21
}
22
23
/// get current time in microseconds
24
pub fn get_time_us() -> usize {
25
- time::read() / (CLOCK_FREQ / MICRO_PER_SEC)
+ time::read() * MICRO_PER_SEC / CLOCK_FREQ
26
27
28
/// Set the next timer interrupt
0 commit comments