diff options
Diffstat (limited to 'opentrack/timer.hpp')
-rw-r--r-- | opentrack/timer.hpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/opentrack/timer.hpp b/opentrack/timer.hpp index 628365c9..eb956213 100644 --- a/opentrack/timer.hpp +++ b/opentrack/timer.hpp @@ -2,6 +2,9 @@ #include <ctime> #if defined (_WIN32) # include <windows.h> +# ifndef CLOCK_MONOTONIC +# define CLOCK_MONOTONIC -1 +# endif static inline void opentrack_clock_gettime(int, struct timespec* ts) { static LARGE_INTEGER freq; @@ -50,12 +53,8 @@ public: Timer() { start(); } - long start() { - struct timespec cur; - (void) clock_gettime(CLOCK_MONOTONIC, &cur); - long ret = conv(cur); - state = cur; - return ret; + void start() { + (void) clock_gettime(CLOCK_MONOTONIC, &state); } long elapsed() { struct timespec cur; |