updated copyright messages for 2013
[deb_libcec.git] / src / lib / platform / util / timeutils.h
index bfbc5c42e444951dd368beffa012021cc0068469..d7c0fe25a0a0dad06ffd41b6d69b5f1a4be84e85 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * This file is part of the libCEC(R) library.
  *
- * libCEC(R) is Copyright (C) 2011-2012 Pulse-Eight Limited.  All rights reserved.
+ * libCEC(R) is Copyright (C) 2011-2013 Pulse-Eight Limited.  All rights reserved.
  * libCEC(R) is an original work, containing original code.
  *
  * libCEC(R) is a trademark of Pulse-Eight Limited.
@@ -31,7 +31,8 @@
  *     http://www.pulse-eight.net/
  */
 
-#include "../os.h"
+#include "env.h"
+#include "lib/platform/os.h"
 
 #if defined(__APPLE__)
 #include <mach/mach_time.h>
@@ -39,6 +40,7 @@
 #elif defined(__WINDOWS__)
 #include <time.h>
 #else
+#include <time.h>
 #include <sys/time.h>
 #endif
 
@@ -78,17 +80,14 @@ namespace PLATFORM
   inline int64_t GetTimeMs()
   {
   #if defined(__APPLE__)
-    return (int64_t) (CVGetCurrentHostTime() / (int64_t)(CVGetHostClockFrequency() * 0.001 + 0.5);
+    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