29 lines
554 B
C++
29 lines
554 B
C++
#ifndef PERFORMANCETIMER_H
|
|
#define PERFORMANCETIMER_H
|
|
|
|
#include <QObject>
|
|
#include <windows.h>
|
|
|
|
class PerformanceTimer : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit PerformanceTimer(QObject *parent = nullptr);
|
|
|
|
~PerformanceTimer();
|
|
signals:
|
|
void timeout();
|
|
public slots:
|
|
void start(int timeInterval);
|
|
void start();
|
|
void stop();
|
|
void setInterval(int interval);
|
|
friend WINAPI void CALLBACK PeriodCycle(uint,uint,DWORD_PTR,DWORD_PTR,DWORD_PTR);
|
|
private:
|
|
int m_interval;
|
|
int m_id;
|
|
|
|
};
|
|
|
|
#endif // PERFORMANCETIMER_H
|