X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=include%2Ftimer.h;h=2200685db7cf338e698b891ae944824938d6db47;hp=d0b5d7f508466219ea690dd618d90e8f9a409440;hb=38ff0dd072e5929bf4a204982f858049dff09b81;hpb=475d51bff7ebb2ca46bd569de248287b28d1bd8a diff --git a/include/timer.h b/include/timer.h index d0b5d7f..2200685 100644 --- a/include/timer.h +++ b/include/timer.h @@ -6,6 +6,10 @@ #include #endif +#ifdef MSVC +#include +#endif + class Timer { public: @@ -51,6 +55,10 @@ class Timer return 0; return (now.tv_sec + static_cast(now.tv_usec) / 1000000.); +#elif defined(MSVC) + struct _timeb now; + _ftime (&now); + return (now.time + static_cast(now.millitm) / 1000.); #else return 0; #endif