r455: no message
[ctsim.git] / include / timer.h
index d0b5d7f508466219ea690dd618d90e8f9a409440..2200685db7cf338e698b891ae944824938d6db47 100644 (file)
@@ -6,6 +6,10 @@
 #include <sys/time.h>
 #endif
 
+#ifdef MSVC
+#include <sys/timeb.h>
+#endif
+
 class Timer
 {
  public:
@@ -51,6 +55,10 @@ class Timer
                return 0;
            
            return (now.tv_sec + static_cast<double>(now.tv_usec) / 1000000.);
+#elif defined(MSVC)
+               struct _timeb now;
+               _ftime (&now);
+               return (now.time + static_cast<double>(now.millitm) / 1000.);
 #else
            return 0;
 #endif