diff --git a/src/platform_compat.cc b/src/platform_compat.cc index b71be7b..69da2c5 100644 --- a/src/platform_compat.cc +++ b/src/platform_compat.cc @@ -21,7 +21,7 @@ #ifdef _WIN32 #include #else -#include +#include #endif int compat_stricmp(const char* string1, const char* string2) @@ -145,8 +145,8 @@ unsigned int compat_timeGetTime() #ifdef _WIN32 return timeGetTime(); #else - struct timeval tv; - gettimeofday(&tv, NULL); - return tv.tv_usec / 1000; + static auto start = std::chrono::steady_clock::now(); + auto now = std::chrono::steady_clock::now(); + return static_cast(std::chrono::duration_cast(now - start).count()); #endif }