summaryrefslogtreecommitdiffstats
path: root/src/server/Engine.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-10-01 20:28:20 -0400
committerDavid Robillard <d@drobilla.net>2016-10-02 12:27:23 -0400
commit3433418d7698060b4307a206c086bb30a45f566b (patch)
treecf9d6790a61b09d7204a7c3b522145828b8f0c7c /src/server/Engine.cpp
parenta2cb63943b9e720be55e175da7c970c8dc3833d9 (diff)
downloadingen-3433418d7698060b4307a206c086bb30a45f566b.tar.gz
ingen-3433418d7698060b4307a206c086bb30a45f566b.tar.bz2
ingen-3433418d7698060b4307a206c086bb30a45f566b.zip
Implement microsecond clock for Linux and OSX
Diffstat (limited to 'src/server/Engine.cpp')
-rw-r--r--src/server/Engine.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/server/Engine.cpp b/src/server/Engine.cpp
index 0b468ce1..2d458bc4 100644
--- a/src/server/Engine.cpp
+++ b/src/server/Engine.cpp
@@ -321,14 +321,7 @@ Engine::event_time()
uint64_t
Engine::current_time(const RunContext& context) const
{
- struct timespec time;
-#ifdef CLOCK_MONOTONIC_RAW
- clock_gettime(CLOCK_MONOTONIC_RAW, &time);
-#else
- clock_gettime(CLOCK_MONOTONIC, &time);
-#endif
-
- return (uint64_t)time.tv_sec * 1e6 + (uint64_t)time.tv_nsec / 1e3;
+ return _clock.now_microseconds();
}
void