diff --git a/src/chrono.cpp b/src/chrono.cpp index c3714208..40e78ff6 100644 --- a/src/chrono.cpp +++ b/src/chrono.cpp @@ -116,10 +116,16 @@ steady_clock::now() steady_clock::time_point steady_clock::now() { +#ifdef __MINGW32__ + timeval tv; + gettimeofday(&tv, 0); + return time_point(seconds(tv.tv_sec) + microseconds(tv.tv_usec)); +#else struct timespec tp; if (0 != clock_gettime(CLOCK_MONOTONIC, &tp)) __throw_system_error(errno, "clock_gettime(CLOCK_MONOTONIC) failed"); return time_point(seconds(tp.tv_sec) + nanoseconds(tp.tv_nsec)); +#endif } #endif // __APPLE__