diff --git a/src/Context.cpp b/src/Context.cpp index c2df43c86..518099b13 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -88,7 +88,6 @@ Context::~Context () int Context::initialize (int argc, const char** argv) { timer_total.start (); - Timer timer_init; int rc = 0; try @@ -293,7 +292,7 @@ int Context::initialize (int argc, const char** argv) std::cerr << e << '\n'; } - time_init_us += timer_init.total_us (); + time_init_us += timer_total.total_us (); return rc; } @@ -311,6 +310,7 @@ int Context::run () hooks.onExit (); // No chance to update data. timer_total.stop (); + time_total_us += timer_total.total_us (); std::stringstream s; s << "Perf " @@ -325,24 +325,22 @@ int Context::run () << ISO8601d ().toISO () << " init:" << time_init_us - << " load:" << static_cast (timer_load.total_us ()) - << " gc:" << time_gc_us - tdb2.load_time_us + << " load:" << time_load_us + << " gc:" << time_gc_us - time_load_us << " filter:" << time_filter_us << " commit:" << time_commit_us << " sort:" << time_sort_us << " render:" << time_render_us << " hooks:" << time_hooks_us - << " other:" << static_cast (timer_total.total_us () - - time_init_us - - timer_load.total_us () - - time_gc_us - - tdb2.load_time_us - - time_filter_us - - time_commit_us - - time_sort_us - - time_render_us - - time_hooks_us) - << " total:" << static_cast (timer_total.total_us ()) + << " other:" << time_total_us - + time_init_us - + time_gc_us - + time_filter_us - + time_commit_us - + time_sort_us - + time_render_us - + time_hooks_us + << " total:" << time_total_us << '\n'; debug (s.str ()); } diff --git a/src/Context.h b/src/Context.h index d9b2e6212..0c249c91b 100644 --- a/src/Context.h +++ b/src/Context.h @@ -99,8 +99,9 @@ public: int terminal_height {0}; Timer timer_total {}; + long time_total_us {0}; long time_init_us {0}; - Timer timer_load; + long time_load_us {0}; long time_gc_us {0}; long time_filter_us {0}; long time_commit_us {0}; diff --git a/src/TDB2.cpp b/src/TDB2.cpp index da4f3a133..9d80cca43 100644 --- a/src/TDB2.cpp +++ b/src/TDB2.cpp @@ -425,7 +425,7 @@ void TF2::load_tasks (bool from_gc /* = false */) throw e + format (STRING_TDB2_PARSE_ERROR, _file._data, line_number); } - context.tdb2.load_time_us += timer.total_us (); + context.time_load_us += timer.total_us (); } //////////////////////////////////////////////////////////////////////////////// diff --git a/src/TDB2.h b/src/TDB2.h index 9f8178f8f..a830355e4 100644 --- a/src/TDB2.h +++ b/src/TDB2.h @@ -154,7 +154,6 @@ public: TF2 completed; TF2 undo; TF2 backlog; - long load_time_us {}; private: std::string _location;