Skip to content

Commit

Permalink
pop_push facility for profiler
Browse files Browse the repository at this point in the history
  • Loading branch information
mlivesu committed Nov 8, 2023
1 parent 0416e83 commit a494e14
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions include/cinolib/profiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions include/cinolib/profiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "");

//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

Expand Down

0 comments on commit a494e14

Please sign in to comment.