diff options
author | Daniel Friesel <derf@finalrewind.org> | 2021-12-29 17:47:56 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2021-12-29 17:47:56 +0100 |
commit | 9318c681f5e198d9541a3259066f415dbd351af0 (patch) | |
tree | 2bdedcced0e4c1bce93d38311fb941ac2ca12f05 /src | |
parent | 12ab229a742cf8121527592d585a9b270752d461 (diff) |
POSIX: Fix uptime.get_us()
Diffstat (limited to 'src')
-rw-r--r-- | src/arch/posix/driver/uptime.cc | 2 |
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() |