summaryrefslogtreecommitdiff
path: root/src/arch/posix
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-12-29 17:47:56 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-12-29 17:47:56 +0100
commit9318c681f5e198d9541a3259066f415dbd351af0 (patch)
tree2bdedcced0e4c1bce93d38311fb941ac2ca12f05 /src/arch/posix
parent12ab229a742cf8121527592d585a9b270752d461 (diff)
POSIX: Fix uptime.get_us()
Diffstat (limited to 'src/arch/posix')
-rw-r--r--src/arch/posix/driver/uptime.cc2
1 files changed, 1 insertions, 1 deletions
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()