diff --git a/internal/ceres/wall_time.cc b/internal/ceres/wall_time.cc index c353973cc..09e3c4a07 100644 --- a/internal/ceres/wall_time.cc +++ b/internal/ceres/wall_time.cc @@ -50,7 +50,12 @@ double WallTimeInSeconds() { return omp_get_wtime(); #else #ifdef _WIN32 - return static_cast(std::time(NULL)); + LARGE_INTEGER count; + LARGE_INTEGER frequency; + QueryPerformanceCounter(&count); + QueryPerformanceFrequency(&frequency); + return static_cast(count.QuadPart) / + static_cast(frequency.QuadPart); #else timeval time_val; gettimeofday(&time_val, NULL);