diff options
author | dhairya <97079960+dhairyarungta@users.noreply.github.com> | 2024-04-13 05:22:31 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-13 00:22:31 +0300 |
commit | d6ce1452872abcd7e5a772f757708a2ad0eee71c (patch) | |
tree | bc051c0f9513129e4e2ff7a2118d3d2aff60407a | |
parent | 70916cbf71f50b9e1e6f13559e10d6dbb92beb32 (diff) | |
download | google-benchmark-d6ce1452872abcd7e5a772f757708a2ad0eee71c.tar.gz |
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.
-rw-r--r-- | src/sysinfo.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sysinfo.cc b/src/sysinfo.cc index 73b46a5..7261e2a 100644 --- a/src/sysinfo.cc +++ b/src/sysinfo.cc @@ -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)); |