Getting CPU Usage
parent
26fc862bdb
commit
142f655f7d
11
Info.hpp
11
Info.hpp
|
|
@ -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__
|
||||
|
|
|
|||
Loading…
Reference in New Issue