diff --git a/include/blt/profiling/profiler_v2.h b/include/blt/profiling/profiler_v2.h index 4efa824..c9db06a 100644 --- a/include/blt/profiling/profiler_v2.h +++ b/include/blt/profiling/profiler_v2.h @@ -80,6 +80,7 @@ namespace blt }; interval_t* createInterval(profile_t& profiler, std::string interval_name); + void startInterval(interval_t* interval); void endInterval(interval_t* interval); @@ -113,6 +114,11 @@ namespace blt blt::startInterval(iv); } + explicit auto_interval(interval_t* iv): iv(iv) + { + blt::startInterval(iv); + } + auto_interval(const auto_interval& i) = delete; auto_interval& operator=(const auto_interval& i) = delete; diff --git a/src/blt/profiling/profiler_v2.cpp b/src/blt/profiling/profiler_v2.cpp index 1e42be4..d3a5e68 100644 --- a/src/blt/profiling/profiler_v2.cpp +++ b/src/blt/profiling/profiler_v2.cpp @@ -127,14 +127,14 @@ namespace blt // we want to use the largest unit possible to keep the numbers small // we might run into a case where something took 1000ns but other thing took 100s // which would be hard to deal with either way. So TODO - if (wall > 1e5 && wall <= 1e8 && container.wall == unit::NS) + if (wall > 1e6 && wall < 1e9 && container.wall == unit::NS) container.wall = unit::MS; - else if (wall > 1e8) + else if (wall > 1e9) container.wall = unit::S; - if (thread > 1e5 && thread <= 1e8 && container.thread == unit::NS) + if (thread > 1e6 && thread < 1e9 && container.thread == unit::NS) container.thread = unit::MS; - else if (thread > 1e8) + else if (thread > 1e9) container.thread = unit::S; return container; }