1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-06 01:28:57 +00:00
CLK/OSBindings/Qt/timer.h

27 lines
486 B
C
Raw Normal View History

#ifndef TIMER_H
#define TIMER_H
2020-06-06 03:06:28 +00:00
#include <atomic>
#include <QObject>
#include "../../Machines/Utility/MachineForTarget.hpp"
class Timer : public QObject
{
Q_OBJECT
public:
explicit Timer(QObject *parent = nullptr);
2020-06-06 03:06:28 +00:00
void setMachine(MachineTypes::TimedMachine *machine, std::mutex *machineMutex);
public slots:
void tick();
private:
MachineTypes::TimedMachine *machine = nullptr;
2020-06-06 03:06:28 +00:00
std::mutex *machineMutex = nullptr;
int64_t lastTickNanos = 0;
};
#endif // TIMER_H