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 a7c82ef commit 5e5f80d
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 @@ -17,12 +17,12 @@ pub fn get_time() -> usize {

/// get 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 5e5f80d

Please sign in to comment.