diff --git a/include/cinolib/profiler.cpp b/include/cinolib/profiler.cpp index a738b9e2..8dbc023a 100644 --- a/include/cinolib/profiler.cpp +++ b/include/cinolib/profiler.cpp @@ -76,6 +76,17 @@ double Profiler::pop(const bool print_time, const std::string extra_string) return t; } + +//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +CINO_INLINE +double Profiler::pop_push(const std::string & new_key, const bool print_time, const std::string extra_string) +{ + double t = pop(print_time,extra_string); + push(new_key); + return t; +} + //:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: CINO_INLINE diff --git a/include/cinolib/profiler.h b/include/cinolib/profiler.h index bb6c384c..c8462e0d 100644 --- a/include/cinolib/profiler.h +++ b/include/cinolib/profiler.h @@ -64,6 +64,7 @@ class Profiler void push(const std::string & key); double pop (const bool print_time = true, const std::string extra_string = ""); + double pop_push(const std::string & new_key, const bool print_time = true, const std::string extra_string = ""); //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::