mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-28 04:27:20 +02:00
Context: Add timer that measures the total command duration explicitly
This commit is contained in:
parent
ed58263c16
commit
b9f217a716
2 changed files with 7 additions and 1 deletions
|
@ -93,6 +93,7 @@ Context::~Context ()
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
int Context::initialize (int argc, const char** argv)
|
int Context::initialize (int argc, const char** argv)
|
||||||
{
|
{
|
||||||
|
timer_total.start ();
|
||||||
timer_init.start ();
|
timer_init.start ();
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
|
@ -315,6 +316,8 @@ int Context::run ()
|
||||||
tdb2.commit (); // Harmless if called when nothing changed.
|
tdb2.commit (); // Harmless if called when nothing changed.
|
||||||
hooks.onExit (); // No chance to update data.
|
hooks.onExit (); // No chance to update data.
|
||||||
|
|
||||||
|
timer_total.stop ();
|
||||||
|
|
||||||
std::stringstream s;
|
std::stringstream s;
|
||||||
s << "Perf "
|
s << "Perf "
|
||||||
<< PACKAGE_STRING
|
<< PACKAGE_STRING
|
||||||
|
@ -335,7 +338,8 @@ int Context::run ()
|
||||||
<< " sort:" << timer_sort.total ()
|
<< " sort:" << timer_sort.total ()
|
||||||
<< " render:" << timer_render.total ()
|
<< " render:" << timer_render.total ()
|
||||||
<< " hooks:" << timer_hooks.total ()
|
<< " hooks:" << timer_hooks.total ()
|
||||||
<< " total:" << (timer_init.total () +
|
<< " other:" << timer_total.total () -
|
||||||
|
(timer_init.total () +
|
||||||
timer_load.total () +
|
timer_load.total () +
|
||||||
timer_gc.total () +
|
timer_gc.total () +
|
||||||
timer_filter.total () +
|
timer_filter.total () +
|
||||||
|
@ -343,6 +347,7 @@ int Context::run ()
|
||||||
timer_sort.total () +
|
timer_sort.total () +
|
||||||
timer_render.total () +
|
timer_render.total () +
|
||||||
timer_hooks.total ())
|
timer_hooks.total ())
|
||||||
|
<< " total:" << timer_total.total ()
|
||||||
<< "\n";
|
<< "\n";
|
||||||
debug (s.str ());
|
debug (s.str ());
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,6 +106,7 @@ public:
|
||||||
int terminal_width;
|
int terminal_width;
|
||||||
int terminal_height;
|
int terminal_height;
|
||||||
|
|
||||||
|
Timer timer_total;
|
||||||
Timer timer_init;
|
Timer timer_init;
|
||||||
Timer timer_load;
|
Timer timer_load;
|
||||||
Timer timer_gc;
|
Timer timer_gc;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue