pgLab/stopwatch.h
Eelke Klein 7f379f3b80 Moved everything associated with executing and explaining queries to querytab.
It is now possible to create multiple independent query tabs. However
somethings are currently a bit broken.
2017-01-21 18:16:57 +01:00

24 lines
416 B
C++

#ifndef STOPWATCH_H
#define STOPWATCH_H
#include <QTimer>
#include <QElapsedTimer>
#include <memory>
class StopWatch : public QObject {
Q_OBJECT
public:
StopWatch();
void start();
qint64 elapsed();
private:
std::unique_ptr<QElapsedTimer> m_elapsed = nullptr; ///< Keeps time
std::unique_ptr<QTimer> m_timer = nullptr; ///< triggers updates
private slots:
void updateTimer();
};
#endif // STOPWATCH_H