We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6cb3e3b commit 7b49e10Copy full SHA for 7b49e10
lib/procinfo_mac.cpp
@@ -178,13 +178,15 @@ int procinfo_setup(PROC_MAP& pm) {
178
// };
179
//
180
double total_cpu_time() {
181
- static natural_t processorCount = 0;
+ static bool first = true;
182
+ natural_t processorCount = 0;
183
processor_cpu_load_info_t cpuLoad;
184
mach_msg_type_number_t processorMsgCount;
185
static double scale;
186
uint64_t totalUserTime = 0;
187
- if (processorCount == 0) {
188
+ if (!first) {
189
+ first = false;
190
long hz = sysconf(_SC_CLK_TCK);
191
scale = 1./hz;
192
}
0 commit comments