Image Component Library (ICL)
|
Tool for benchmarking method calls. More...
#include <StackTimer.h>
Classes | |
class | StackTimerNotifier |
StackTimerNotifier constructor, USE BENCHMARK_THIS_FUNCTION-MACRO instead. More... | |
Public Member Functions | |
StackTimer (StackTimerNotifier *notifier) | |
StackTimer constructor, USE BENCHMARK_THIS_FUNCTION-MACRO instead. More... | |
~StackTimer () | |
StackTimerNotifier destructor, USE BENCHMARK_THIS_FUNCTION-MACRO instead. More... | |
Private Attributes | |
Timer * | m_poTimer |
StackTimerNotifier * | m_poNotifier |
Tool for benchmarking method calls.
The stack timer class is an Extension of the Timer class, that provides very convenient function benchmarking functionality. The only thing, a programmer needs to do, is to write the Macro BENCHMARK_THIS_FUNCTION at the beginning of the function(s), that should be benchmarked. The underlying implementation will then record each function call and execution time. At the end of the programm, the implicitly crated StackTimerNotifier will print the following information about the benchmarked function:
See also the following example:
void funcion1(...){ BENCHMARK_THIS_FUNCTION; ... ... } void funcion2(...){ BENCHMARK_THIS_FUNCTION; ... ... }
At the end of the programm, the following info could be given to you:
calls[ 361] time[ 77.7 ms] avg[ 215 us] min[ 183 us] max[ 5.2 ms] {function1} calls[ 361] time[ 1.7 ms] avg[ 4 us] min[ 4 us] max[ 51 us] {function2}
s = seconds ms = milliseconds us = microseconds
If sections of code shall be benchmarked, this can be done with the BENCHMARK_THIS_SECTION macro
}
|
inline |
StackTimer constructor, USE BENCHMARK_THIS_FUNCTION-MACRO instead.
|
inline |
StackTimerNotifier destructor, USE BENCHMARK_THIS_FUNCTION-MACRO instead.
|
private |
|
private |