diff --git a/source/utils/SystemSpecs.cpp b/source/utils/SystemSpecs.cpp index 9c56b67..c959502 100644 --- a/source/utils/SystemSpecs.cpp +++ b/source/utils/SystemSpecs.cpp @@ -112,25 +112,27 @@ static unsigned long long _previousTotalTicks = 0; static unsigned long long _previousIdleTicks = 0; - SystemSpecs::getCPULoad() { - host_cpu_load_info_data_t cpuinfo; - mach_msg_type_number_t count = HOST_CPU_LOAD_INFO_COUNT; - if (host_statistics(mach_host_self(), HOST_CPU_LOAD_INFO, (host_info_t)&cpuinfo, &count) == KERN_SUCCESS) - { - unsigned long long totalTicks = 0; - for(int i=0; i 0) ? ((float)idleTicksSinceLastTime)/totalTicksSinceLastTime : 0); - _previousTotalTicks = totalTicks; - _previousIdleTicks = idleTicks; - return ret; + double SystemSpecs::calculateCPULoad() { +// unsigned long long totalTicksSinceLastTime = totalTicks-_previousTotalTicks; +// unsigned long long idleTicksSinceLastTime = idleTicks-_previousIdleTicks; +// float ret = 1.0f-((totalTicksSinceLastTime > 0) ? ((float)idleTicksSinceLastTime)/totalTicksSinceLastTime : 0); +// _previousTotalTicks = totalTicks; +// _previousIdleTicks = idleTicks; +// return ret; + return 0.0; } #endif