-
Notifications
You must be signed in to change notification settings - Fork 0
/
systeminfo.h
34 lines (26 loc) · 879 Bytes
/
systeminfo.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef SYSTEMINFO_H
#define SYSTEMINFO_H
#include <QObject>
#include <windows.h>
//creates a static variable to convert Bytes to Megabytes
#define MB 1048576
class SystemInfo /*final */: public QObject
{
Q_OBJECT
public:
explicit SystemInfo(QObject *parent = nullptr)/* = delete*/;
// Memory
static MEMORYSTATUSEX GetMemoryInfo();
static long GetVirtualMemoryCommited();
static long GetVirtualMemoryAvailable();
static long GetPhysicalMemoryUsed();
static long GetPhysicalMemoryAvailable();
static long GetPhysicalMemoryLoad();
static long GetVirtualTotal();
static long GetPhysicalTotal();
// CPU
static unsigned long long FileTimeToInt64(const FILETIME & ft);
static float CalculateCPULoad(unsigned long long idleTicks, unsigned long long totalTicks);
static long GetCPULoad();
};
#endif // SYSTEMINFO_H