Closed chrisdonlan closed 3 years ago
In order to get around this, I deleted the following function entirely (there are no uses in the project):
void* LoadNmvlLibrary()
And I commented out the content here:
float getCpuLoad()
{
/*
static uint64_t _previousTotalTicks = 0;
static uint64_t _previousIdleTicks = 0;
FILETIME idleTime, kernelTime, userTime;
GetSystemTimes(&idleTime, &kernelTime, &userTime);
auto FileTimeToInt64 = [](const FILETIME& ft) {
return (((uint64_t)(ft.dwHighDateTime)) << 32) | ((uint64_t)ft.dwLowDateTime);
};
auto totalTicks = FileTimeToInt64(kernelTime) + FileTimeToInt64(userTime);
auto idleTicks = FileTimeToInt64(idleTime);
uint64_t totalTicksSinceLastTime = totalTicks - _previousTotalTicks;
uint64_t idleTicksSinceLastTime = idleTicks - _previousIdleTicks;
float result = 1.0f - ((totalTicksSinceLastTime > 0) ? ((float)idleTicksSinceLastTime) / totalTicksSinceLastTime : 0);
_previousTotalTicks = totalTicks;
_previousIdleTicks = idleTicks;
*/
// return result * 100.f;
return -1 * 100.f;
}
The CPU function seems approachable, so I am working on a linux work-around to get the CPU load in either a cross platform manner, or a switchable manner with macros.
But, I would have no idea where to start in LoadNmvlLibrary()
.
We should have it working under Linux. Thanks for reporting.
The
cfgmgr.h
is a windows-specific dependency preventing compilation on Linux.