Not compiling but lots of progress

This commit is contained in:
Ben
2018-12-06 22:23:37 +00:00
parent 914f47f9ef
commit a6267d24d8
6 changed files with 165 additions and 4 deletions

View File

@@ -0,0 +1,38 @@
#pragma once
#include <atomic>
#include <thread>
class CPU {
public:
CPU();
std::atomic<int> CPU_PREVIOUS_IDLE;
std::atomic<int> CPU_PREVIOUS_TOTAL;
std::atomic<int> CPU_IDLE;
std::atomic<int> CPU_TOTAL;
std::atomic<int> UPDATE_INTERVAL; // ms
void START_CPU_POLLING();
static void CPU_POLL();
void END_CPU_POLLING();
double CPU_PERCENT();
virtual ~CPU();
private:
std::thread* m_pollThread;
std::atomic<bool> m_isPolling;
};
static CPU* instance;
static CPU* GetCPUInstance() {
if (instance == (void*)0) {
CPU cpu;
instance = &cpu;
return instance;
}
return instance;
}