summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2024-07-17 17:19:01 -0400
committerDavid Robillard <d@drobilla.net>2024-07-17 17:19:01 -0400
commit3b3ff5422167991ce0ad2707c479f5054a565bbd (patch)
tree60fde9535bb0c951c81a3589553a897257391685 /include
parent6bd2c9c327aa4b4cfe431f2c729f6dd0f1a10083 (diff)
downloadingen-3b3ff5422167991ce0ad2707c479f5054a565bbd.tar.gz
ingen-3b3ff5422167991ce0ad2707c479f5054a565bbd.tar.bz2
ingen-3b3ff5422167991ce0ad2707c479f5054a565bbd.zip
Fix clock microseconds conversion
This was off by a factor of 10 on non-Mach systems, due to a previous mistaken replacement of 1e3 with 100 (instead of the correct 1000).
Diffstat (limited to 'include')
-rw-r--r--include/ingen/Clock.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/ingen/Clock.hpp b/include/ingen/Clock.hpp
index 75575aa5..6a966701 100644
--- a/include/ingen/Clock.hpp
+++ b/include/ingen/Clock.hpp
@@ -37,7 +37,7 @@ public:
uint64_t now_microseconds() const {
const uint64_t now = mach_absolute_time();
- return now * _timebase.numer / _timebase.denom / 1e3;
+ return now * _timebase.numer / _timebase.denom / 1000U;
}
private:
@@ -49,7 +49,7 @@ private:
struct timespec time{};
clock_gettime(_clock, &time);
return static_cast<uint64_t>(time.tv_sec) * 1000000U +
- static_cast<uint64_t>(time.tv_nsec) / 100U;
+ static_cast<uint64_t>(time.tv_nsec) / 1000U;
}
private: