diff --git a/src/tester.c b/src/tester.c index 10e3bdc..e7a79f4 100644 --- a/src/tester.c +++ b/src/tester.c @@ -9,7 +9,12 @@ #include #include -#ifndef _MSC_VER +#if defined(BINJNES_MSVC) +#define WIN32_LEAN_AND_MEAN +#define NOMINMAX +#include +#undef ERROR +#else #include #endif @@ -79,8 +84,11 @@ void usage(int argc, char** argv) { static f64 get_time_sec(void) { #ifdef _MSC_VER - // TODO(binji): Windows equivalent of gettimeofday. - return 0; + // https://stackoverflow.com/a/34833160 + LARGE_INTEGER fq, t; + QueryPerformanceFrequency(&fq); + QueryPerformanceCounter(&t); + return (f64)(1000000 * t.QuadPart) / (fq.QuadPart * 1000000.0); #else struct timeval tp; gettimeofday(&tp, NULL);