1
0
mirror of https://github.com/google/benchmark.git synced 2025-04-13 13:01:54 +08:00

Refactor: Return frequency as double

Adjusted the GetSysctl call in sysinfo.cc to ensure the frequency
value is returned as a double rather than an integer. This helps
maintain consistency and clarity in the codebase.
This commit is contained in:
dhairyarungta 2024-04-12 22:16:45 +08:00
parent 70916cbf71
commit 7063adfa11

View File

@ -736,7 +736,7 @@ double GetCPUCyclesPerSecond(CPUInfo::Scaling scaling) {
#if defined BENCHMARK_OS_OPENBSD
if (GetSysctl(freqStr, &hz)) return static_cast<double>(hz * 1000000);
#else
if (GetSysctl(freqStr, &hz)) return hz;
if (GetSysctl(freqStr, &hz)) return static_cast<double>(hz);
#endif
fprintf(stderr, "Unable to determine clock rate from sysctl: %s: %s\n",
freqStr, strerror(errno));