From ced7490df6de8c08c4f6edf3fb279b4b9e71005f Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 13 Nov 2016 13:08:04 -0500 Subject: [PATCH] TDB2: Migrated to libshared Timer --- src/TDB2.cpp | 8 ++------ src/TDB2.h | 1 + 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/TDB2.cpp b/src/TDB2.cpp index f53332aed..34b085a2d 100644 --- a/src/TDB2.cpp +++ b/src/TDB2.cpp @@ -381,7 +381,7 @@ void TF2::load_gc (Task& task) //////////////////////////////////////////////////////////////////////////////// void TF2::load_tasks (bool from_gc /* = false */) { - context.timer_load.start (); + Timer timer; if (! _loaded_lines) { @@ -425,7 +425,7 @@ void TF2::load_tasks (bool from_gc /* = false */) throw e + format (STRING_TDB2_PARSE_ERROR, _file._data, line_number); } - context.timer_load.stop (); + context.tdb2.load_time_us += timer.total_us (); } //////////////////////////////////////////////////////////////////////////////// @@ -1254,7 +1254,6 @@ void TDB2::show_diff ( void TDB2::gc () { context.timer_gc.start (); - unsigned long load_start = context.timer_load.total (); // Allowed as an override, but not recommended. if (context.config.getBoolean ("gc")) @@ -1291,10 +1290,7 @@ void TDB2::gc () completed.dependency_scan (); } - // Stop and remove accumulated load time from the GC time, because they - // overlap. context.timer_gc.stop (); - context.timer_gc.subtract (context.timer_load.total () - load_start); } //////////////////////////////////////////////////////////////////////////////// diff --git a/src/TDB2.h b/src/TDB2.h index a830355e4..9f8178f8f 100644 --- a/src/TDB2.h +++ b/src/TDB2.h @@ -154,6 +154,7 @@ public: TF2 completed; TF2 undo; TF2 backlog; + long load_time_us {}; private: std::string _location;