QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
qgsruntimeprofiler.h
Go to the documentation of this file.
1 #ifndef QGSRUNTIMEPROFILER_H
2 #define QGSRUNTIMEPROFILER_H
3 
4 #include <QTime>
5 #include <QPair>
6 #include <QStack>
7 
11 class CORE_EXPORT QgsRuntimeProfiler
12 {
13  public:
18 
24  static QgsRuntimeProfiler * instance();
25 
31  void beginGroup( const QString& name );
32 
36  void endGroup();
37 
43  void start( const QString& name );
44 
48  void end();
49 
55  const QList<QPair<QString, double > > profileTimes() const { return mProfileTimes; }
56 
60  void clear();
61 
66  double totalTime();
67 
68  private:
69  static QgsRuntimeProfiler* mInstance;
70 
71  QString mGroupPrefix;
72  QStack<QString> mGroupStack;
73  QTime mProfileTime;
74  QString mCurrentName;
75  QList<QPair<QString, double > > mProfileTimes;
76 };
77 
78 #endif // QGSRUNTIMEPROFILER_H
const QList< QPair< QString, double > > profileTimes() const
Return all the current profile times.