From 3127f60885e5b76be2265048bf9a6eff79c284f1 Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Wed, 21 Mar 2012 16:17:30 +0100 Subject: [PATCH] cec: fixed - frequency wasn't checked in GetTimeMs(), leading to incorrect wait times on some windows systems --- src/lib/platform/util/timeutils.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/lib/platform/util/timeutils.h b/src/lib/platform/util/timeutils.h index f4f2810..5f2d27a 100644 --- a/src/lib/platform/util/timeutils.h +++ b/src/lib/platform/util/timeutils.h @@ -80,15 +80,12 @@ namespace PLATFORM #if defined(__APPLE__) return (int64_t) (CVGetCurrentHostTime() / (int64_t)(CVGetHostClockFrequency() * 0.001)); #elif defined(__WINDOWS__) - time_t rawtime; - time(&rawtime); - LARGE_INTEGER tickPerSecond; LARGE_INTEGER tick; if (QueryPerformanceFrequency(&tickPerSecond)) { QueryPerformanceCounter(&tick); - return (int64_t) (tick.QuadPart / 1000.); + return (int64_t) (tick.QuadPart / (tickPerSecond.QuadPart / 1000.)); } return -1; #else -- 2.34.1