Context: Migrated to libshared Timer

This commit is contained in:
Paul Beckingham 2016-11-13 13:10:48 -05:00
parent ced7490df6
commit 0849501ef5
2 changed files with 23 additions and 22 deletions

View file

@ -103,7 +103,7 @@ Context::~Context ()
int Context::initialize (int argc, const char** argv) int Context::initialize (int argc, const char** argv)
{ {
timer_total.start (); timer_total.start ();
timer_init.start (); Timer timer_init;
int rc = 0; int rc = 0;
try try
@ -308,7 +308,7 @@ int Context::initialize (int argc, const char** argv)
std::cerr << e << '\n'; std::cerr << e << '\n';
} }
timer_init.stop (); time_init_us += timer_init.total_us ();
return rc; return rc;
} }
@ -339,24 +339,25 @@ int Context::run ()
<< ' ' << ' '
<< ISO8601d ().toISO () << ISO8601d ().toISO ()
<< " init:" << timer_init.total () << " init:" << time_init_us
<< " load:" << timer_load.total () << " load:" << static_cast <long> (timer_load.total_us ())
<< " gc:" << timer_gc.total () << " gc:" << static_cast <long> (timer_gc.total_us () - tdb2.load_time_us)
<< " filter:" << timer_filter.total () << " filter:" << static_cast <long> (timer_filter.total_us ())
<< " commit:" << timer_commit.total () << " commit:" << static_cast <long> (timer_commit.total_us ())
<< " sort:" << timer_sort.total () << " sort:" << static_cast <long> (timer_sort.total_us ())
<< " render:" << timer_render.total () << " render:" << static_cast <long> (timer_render.total_us ())
<< " hooks:" << timer_hooks.total () << " hooks:" << static_cast <long> (timer_hooks.total_us ())
<< " other:" << timer_total.total () - << " other:" << static_cast <long> (timer_total.total_us () -
timer_init.total () - time_init_us -
timer_load.total () - timer_load.total_us () -
timer_gc.total () - timer_gc.total_us () -
timer_filter.total () - tdb2.load_time_us -
timer_commit.total () - timer_filter.total_us () -
timer_sort.total () - timer_commit.total_us () -
timer_render.total () - timer_sort.total_us () -
timer_hooks.total () timer_render.total_us () -
<< " total:" << timer_total.total () timer_hooks.total_us ())
<< " total:" << static_cast <long> (timer_total.total_us ())
<< '\n'; << '\n';
debug (s.str ()); debug (s.str ());
} }

View file

@ -104,8 +104,8 @@ public:
int terminal_width; int terminal_width;
int terminal_height; int terminal_height;
Timer timer_total; Timer timer_total {};
Timer timer_init; long time_init_us {0};
Timer timer_load; Timer timer_load;
Timer timer_gc; Timer timer_gc;
Timer timer_filter; Timer timer_filter;