Skip to content

Commit

Permalink
Refactor: Return frequency as double (#1782)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dhairyarungta authored Apr 12, 2024
1 parent 70916cb commit d6ce145
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sysinfo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit d6ce145

Please sign in to comment.