From 9318c681f5e198d9541a3259066f415dbd351af0 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 29 Dec 2021 17:47:56 +0100 Subject: POSIX: Fix uptime.get_us() --- src/arch/posix/driver/uptime.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/arch/posix') diff --git a/src/arch/posix/driver/uptime.cc b/src/arch/posix/driver/uptime.cc index 5c6ccd4..f30382a 100644 --- a/src/arch/posix/driver/uptime.cc +++ b/src/arch/posix/driver/uptime.cc @@ -17,7 +17,7 @@ uint64_t Uptime::get_us() { struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); - return ts.tv_nsec / 1000; + return (uint64_t)ts.tv_sec * 1000000 + ts.tv_nsec / 1000; } uint64_t Uptime::get_cycles() -- cgit v1.2.3