Getting CPU Usage

master
ColumbusTech 2017-11-24 22:02:36 +03:00
parent 26fc862bdb
commit 142f655f7d
1 changed files with 11 additions and 0 deletions

View File

@ -11,6 +11,8 @@ namespace Columbus
int GetCPUCount();
int GetCPUCacheSize();
int GetCPUUsage();
int GetCPUTemperature();
unsigned long GetRAMSize();
unsigned long GetRAMFree();
@ -57,6 +59,15 @@ namespace Columbus
#endif
}
int GetCPUUsage()
{
#ifdef __linux__
double load[3];
getloadavg(load, 3);
return static_cast<int>(load[0] * 100);
#endif
}
unsigned long GetRAMSize()
{
#ifdef __linux__