Skip to content

Commit

Permalink
Update timer.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
田凯夫 committed Mar 5, 2024
1 parent 14c0c0b commit 37bf4bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions os/src/timer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ pub fn get_time() -> usize {

/// Get the current time in milliseconds
pub fn get_time_ms() -> usize {
time::read() / (CLOCK_FREQ / MSEC_PER_SEC)
time::read() * MSEC_PER_SEC / CLOCK_FREQ
}

/// get current time in microseconds
pub fn get_time_us() -> usize {
time::read() / (CLOCK_FREQ / MICRO_PER_SEC)
time::read() * MICRO_PER_SEC / CLOCK_FREQ
}

/// Set the next timer interrupt
Expand Down

0 comments on commit 37bf4bf

Please sign in to comment.