first commit
This commit is contained in:
38
project/fm_viewer/fav/fav_profile.h
Normal file
38
project/fm_viewer/fav/fav_profile.h
Normal file
@@ -0,0 +1,38 @@
|
||||
|
||||
#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
|
||||
Reference in New Issue
Block a user