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 01d411e commit befccb2Copy full SHA for befccb2
os/src/timer.rs
@@ -19,13 +19,13 @@ pub fn get_time() -> usize {
19
/// get current time in milliseconds
20
#[allow(dead_code)]
21
pub fn get_time_ms() -> usize {
22
- time::read() / (CLOCK_FREQ / MSEC_PER_SEC)
+ time::read() * MSEC_PER_SEC / CLOCK_FREQ
23
}
24
25
/// get current time in microseconds
26
27
pub fn get_time_us() -> usize {
28
- time::read() / (CLOCK_FREQ / MICRO_PER_SEC)
+ time::read() * MICRO_PER_SEC / CLOCK_FREQ
29
30
31
/// Set the next timer interrupt
0 commit comments