QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgsruntimeprofiler.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsruntimeprofiler.h
3  ---------------------
4  begin : June 2016
5  copyright : (C) 2016 by Nathan Woodrow
6  email : woodrow dot nathan at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 #ifndef QGSRUNTIMEPROFILER_H
16 #define QGSRUNTIMEPROFILER_H
17 
18 #include <QTime>
19 #include <QElapsedTimer>
20 #include "qgis_sip.h"
21 #include <QPair>
22 #include <QStack>
23 #include <QList>
24 
25 #include "qgis_core.h"
26 
31 class CORE_EXPORT QgsRuntimeProfiler
32 {
33  public:
34 
38  QgsRuntimeProfiler() = default;
39 
47  Q_DECL_DEPRECATED void beginGroup( const QString &name ) SIP_DEPRECATED;
48 
54  Q_DECL_DEPRECATED void endGroup() SIP_DEPRECATED;
55 
60  QStringList childGroups( const QString &parent = QString() ) const;
61 
67  void start( const QString &name );
68 
72  void end();
73 
78  double profileTime( const QString &name ) const;
79 
83  void clear();
84 
89  double totalTime();
90 
91  private:
92 
93  QStack< QElapsedTimer > mProfileTime;
94  QStack< QString > mCurrentName;
95  QList< QPair< QString, double > > mProfileTimes;
96 };
97 
98 
115 class CORE_EXPORT QgsScopedRuntimeProfile
116 {
117  public:
118 
125  QgsScopedRuntimeProfile( const QString &name );
126 
131 
132 };
133 
134 
135 #endif // QGSRUNTIMEPROFILER_H
QgsRuntimeProfiler
Definition: qgsruntimeprofiler.h:31
SIP_DEPRECATED
#define SIP_DEPRECATED
Definition: qgis_sip.h:106
qgis_sip.h
QgsScopedRuntimeProfile
Definition: qgsruntimeprofiler.h:115