Timer class that writes timings to the Debug-Output-Channel.
The class writes the elapsed time to qDebug() when either destructed, or when explicitely showElapsed() is called. elapsed() queries the elapsed time in milliseconds since construction or start() is called. Using interval() one can write a message with the time elapsed up the calling time, and the clock is reset afterwards. The name of the timer is set during construction. This message is printed when showElapsed() is called or durig destruction. Additionally, elapsed times of timers sharing the same caption are aggregated. Use clearAllTimers() to reset and printAllTimers() print the sums to the debug console. "Silent" DebugOutputs (setSilent() don't print timings for each iteration, but are still counted in the sums. If setAsWarning() is issued, the debug messages are print as warning, thus also visible when debug messages are disabled.
void foo() {
<some lengthy operation>
}
void bar() {
for (i=0;i<1000;i++)
foo();
}
Timer class that writes timings to the Debug-Output-Channel.
Definition: debugtimer.h:50
static void clearAllTimers()
Definition: debugtimer.cpp:89
static void printAllTimers()
Definition: debugtimer.cpp:97
For Windows, the "TickTack"-backend is used.