From 1deb27d502ae5e6d897e71177e9509e3fe9e941b Mon Sep 17 00:00:00 2001 From: Zachary Lund Date: Sat, 11 Jan 2014 15:08:04 -0600 Subject: [PATCH] Fixed os_gettime_ns to provide correct time in ns --- libobs/util/platform-nix.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libobs/util/platform-nix.c b/libobs/util/platform-nix.c index 3fbfefc66..d336f2679 100644 --- a/libobs/util/platform-nix.c +++ b/libobs/util/platform-nix.c @@ -77,9 +77,9 @@ void os_sleep_ms(uint32_t duration) uint64_t os_gettime_ns(void) { - struct timespec tp; - clock_gettime(CLOCK_REALTIME, &tp); - return tp.tv_nsec; + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); + return ((uint64_t) ts.tv_sec * 1000000000ULL + (uint64_t) ts.tv_nsec); } /* should return $HOME/.[name] */