From ff51cb832f4e4d9e2c0999c7b996670cda7d003e Mon Sep 17 00:00:00 2001 From: Kirin <1370302499@qq.com> Date: Fri, 25 Mar 2022 14:17:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20`get=5Ftime=5Fus`=20?= =?UTF-8?q?=E7=9A=84=E7=B2=BE=E5=BA=A6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- os/src/timer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os/src/timer.rs b/os/src/timer.rs index 4f40494c..6ba55bf3 100644 --- a/os/src/timer.rs +++ b/os/src/timer.rs @@ -14,7 +14,7 @@ pub fn get_time() -> usize { /// get current time in microseconds pub fn get_time_us() -> usize { - time::read() / (CLOCK_FREQ / MICRO_PER_SEC) + (time::read() as f64 / (CLOCK_FREQ as f64 / MICRO_PER_SEC as f64)) as _ } /// set the next timer interrupt