aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordhairya <97079960+dhairyarungta@users.noreply.github.com>2024-04-13 05:22:31 +0800
committerGitHub <noreply@github.com>2024-04-13 00:22:31 +0300
commitd6ce1452872abcd7e5a772f757708a2ad0eee71c (patch)
treebc051c0f9513129e4e2ff7a2118d3d2aff60407a
parent70916cbf71f50b9e1e6f13559e10d6dbb92beb32 (diff)
downloadgoogle-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.cc2
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));