mirror of
https://github.com/google/benchmark.git
synced 2024-12-27 13:00:36 +08:00
Refactor: Return frequency as double (#1782)
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:
parent
70916cbf71
commit
d6ce145287
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user