From 142f655f7d5054ea08d35d5a8b8b70e60df65b15 Mon Sep 17 00:00:00 2001 From: ColumbusTech Date: Fri, 24 Nov 2017 22:02:36 +0300 Subject: [PATCH] Getting CPU Usage --- Info.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Info.hpp b/Info.hpp index 4b35a75..6376a8a 100644 --- a/Info.hpp +++ b/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(load[0] * 100); + #endif + } + unsigned long GetRAMSize() { #ifdef __linux__