aboutsummaryrefslogtreecommitdiff
path: root/src/common/perf_timer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/perf_timer.h')
-rw-r--r--src/common/perf_timer.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/common/perf_timer.h b/src/common/perf_timer.h
index 2b318bff2..536cfddd0 100644
--- a/src/common/perf_timer.h
+++ b/src/common/perf_timer.h
@@ -48,6 +48,8 @@ class PerformanceTimer
public:
PerformanceTimer(const std::string &s, uint64_t unit, el::Level l = el::Level::Debug);
~PerformanceTimer();
+ void pause();
+ void resume();
private:
std::string name;
@@ -55,6 +57,7 @@ private:
el::Level level;
uint64_t ticks;
bool started;
+ bool paused;
};
void set_performance_timer_log_level(el::Level level);
@@ -66,5 +69,7 @@ void set_performance_timer_log_level(el::Level level);
#define PERF_TIMER_START_UNIT(name, unit) std::unique_ptr<tools::PerformanceTimer> pt_##name(new tools::PerformanceTimer(#name, unit, el::Level::Info))
#define PERF_TIMER_START(name) PERF_TIMER_START_UNIT(name, 1000)
#define PERF_TIMER_STOP(name) do { pt_##name.reset(NULL); } while(0)
+#define PERF_TIMER_PAUSE(name) pt_##name->pause()
+#define PERF_TIMER_RESUME(name) pt_##name->resume()
}