os-x: fixed GetTimeMs() on OS-X (hopefully). credits @bobo1on1
[deb_libcec.git] / 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);