opencv_mv/QMainPro/QMacVisual/showcpumemory.h

40 lines
707 B
C
Raw Normal View History

2023-05-22 09:27:46 +00:00
#pragma once
#pragma execution_character_set("utf-8")
#include <QObject>
#include "winsock2.h"
class QLabel;
class QTimer;
class QProcess;
class ShowCpuMemory : public QObject
{
Q_OBJECT
public:
explicit ShowCpuMemory(QObject *parent = 0);
void SetLab(QLabel *labCPUMemory);
private:
int memoryPercent;
int memoryAll;
int memoryUse;
int memoryFree;
QLabel *labMemory; //<2F><>ʾ<EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD>Ϣ<EFBFBD>Ŀؼ<C4BF>
QProcess *process;
int cpu;
public slots:
void GetCpuMemory();
private slots:
int calCpuUsage();
//ʱ<><CAB1>ת<EFBFBD><D7AA>
__int64 Filetime2Int64(const FILETIME* ftime);
//<2F><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
__int64 CompareFileTime(FILETIME preTime, FILETIME nowTime);
};