From: Lars Op den Kamp Date: Sat, 3 Mar 2012 16:17:37 +0000 (+0100) Subject: os-x: fixed GetTimeMs() on OS-X (hopefully). credits @bobo1on1 X-Git-Tag: upstream/2.2.0~1^2~31^2~103 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=cc52a02091e15454ff6b832fec3a1abd9aae472e;p=deb_libcec.git os-x: fixed GetTimeMs() on OS-X (hopefully). credits @bobo1on1 --- diff --git a/src/lib/platform/util/timeutils.h b/src/lib/platform/util/timeutils.h index b886f88..bfbc5c4 100644 --- a/src/lib/platform/util/timeutils.h +++ b/src/lib/platform/util/timeutils.h @@ -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);