From af9211a1a0f913222db20263003ebc17e4ad1f66 Mon Sep 17 00:00:00 2001 From: VaclavT Date: Mon, 19 Apr 2021 21:11:22 +0200 Subject: [PATCH] clear call stack added --- ml_profiler.cpp | 4 ++++ ml_profiler.h | 1 + 2 files changed, 5 insertions(+) diff --git a/ml_profiler.cpp b/ml_profiler.cpp index 50cc81e..873ec0a 100644 --- a/ml_profiler.cpp +++ b/ml_profiler.cpp @@ -47,6 +47,10 @@ std::string MlPerfMon::callstack() const { return cs.append("\n"); } +void MlPerfMon::clear_callstack() { + call_stack.empty(); +} + void MlPerfMon::print_results() { if (perfOn) { std::chrono::time_point end_time = std::chrono::high_resolution_clock::now(); diff --git a/ml_profiler.h b/ml_profiler.h index 5fefa47..31257b1 100644 --- a/ml_profiler.h +++ b/ml_profiler.h @@ -28,6 +28,7 @@ public: void add_method_call(const std::string &method); void end_method_call(); std::string callstack() const; + void clear_callstack(); void print_results(); private: