os-x: fixed GetTimeMs() on OS-X (hopefully). credits @bobo1on1
authorLars Op den Kamp <lars@opdenkamp.eu>
Sat, 3 Mar 2012 16:17:37 +0000 (17:17 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Sat, 3 Mar 2012 16:18:42 +0000 (17:18 +0100)
src/lib/platform/util/timeutils.h

index b886f88a1cd58511b5cf03d9088af3456f6d54ac..bfbc5c42e444951dd368beffa012021cc0068469 100644 (file)
@@ -78,7 +78,7 @@ namespace PLATFORM
   inline int64_t GetTimeMs()
   {
   #if defined(__APPLE__)
-    return (int64_t) (CVGetCurrentHostTime() * 1000 / CVGetHostClockFrequency());
+    return (int64_t) (CVGetCurrentHostTime() / (int64_t)(CVGetHostClockFrequency() * 0.001 + 0.5);
   #elif defined(__WINDOWS__)
     time_t rawtime;
     time(&rawtime);