diff options
Diffstat (limited to 'opentrack-compat/timer.hpp')
-rw-r--r-- | opentrack-compat/timer.hpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/opentrack-compat/timer.hpp b/opentrack-compat/timer.hpp index 1d424832..f0741295 100644 --- a/opentrack-compat/timer.hpp +++ b/opentrack-compat/timer.hpp @@ -24,9 +24,7 @@ static inline void opentrack_clock_gettime(int, struct timespec* ts) (void) QueryPerformanceCounter(&d); - long long part = d.QuadPart; - part *= 1000000000ULL; - part /= freq.QuadPart; + long long part = d.QuadPart / ((long double)freq.QuadPart) * 1000000000.L; ts->tv_sec = part / 1000000000ULL; ts->tv_nsec = part % 1000000000ULL; |