Files
fmviewer3/project/fm_viewer/fav/fav_profile.h
2026-02-21 17:11:31 +09:00

39 lines
821 B
C++

#ifndef FAVPROFILE_H
#define FAVPROFILE_H
#if (PROFILE_BUILD)
#include <QObject>
#include <QElapsedTimer>
class FAVProfile : public QObject
{
Q_OBJECT
public:
static FAVProfile* instance()
{
static FAVProfile * _instance = 0;
if ( _instance == NULL ) {
_instance = new FAVProfile();
}
return _instance;
}
static qint64 elapsed(QString msg);
static void restart(QString msg);
static qint64 elapsed() {
return instance()->_timer.elapsed();
}
static void lapStart() {
instance()->_lastLap = FAVProfile::elapsed();
}
static void lapEnd(QString msg);
private:
QElapsedTimer _timer;
qint64 _lastLap;
explicit FAVProfile(QObject *parent = nullptr);
signals:
};
#endif // PROFILE_BUILD
#endif // FAVPROFILE_H