diff --git a/lapack/dsecnd_INT_CPU_TIME.cpp b/lapack/dsecnd_INT_CPU_TIME.cpp index 50521366c..684fa1d78 100644 --- a/lapack/dsecnd_INT_CPU_TIME.cpp +++ b/lapack/dsecnd_INT_CPU_TIME.cpp @@ -22,6 +22,9 @@ double dsecnd_(); // Elapsed CPU Time in seconds. double dsecnd_() { #ifdef _WIN32 + // For MSVC, use `GetProcessTimes` for proper CPU time - MSVC uses + // a non-standard `std::clock` implementation (see + // https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/clock?view=msvc-170). // GetProcessTimes() uses 100-nanosecond time units. FILETIME creation_time, exit_time, kernel_time, user_time; GetProcessTimes(GetCurrentProcess(), &creation_time, &exit_time, &kernel_time, &user_time); diff --git a/lapack/second_INT_CPU_TIME.cpp b/lapack/second_INT_CPU_TIME.cpp index 07231a34e..d6eb4029b 100644 --- a/lapack/second_INT_CPU_TIME.cpp +++ b/lapack/second_INT_CPU_TIME.cpp @@ -22,6 +22,9 @@ float second_(); // Elapsed CPU Time in seconds. float second_() { #ifdef _WIN32 + // For MSVC, use `GetProcessTimes` for proper CPU time - MSVC uses + // a non-standard `std::clock` implementation (see + // https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/clock?view=msvc-170). // GetProcessTimes() uses 100-nanosecond time units. FILETIME creation_time, exit_time, kernel_time, user_time; GetProcessTimes(GetCurrentProcess(), &creation_time, &exit_time, &kernel_time, &user_time);