#8 Statistics/Profiling helper class

open
nobody
None
5
2004-10-15
2004-10-15
Andreas Kahler
No

A helper class that allows you to trace some numbers
and/or times during rendering and outputs some
statistics at the end, like min value + max value + avg
value + number of values traced.
This would be useful for optimizing algorithms.
It should be possible to switch off the complete tracking
so that no performance drop occurs (maybe make
defines that can be switched to empty operations)

Could look like

TRACE_NUMBER("MyTracedValue", CurrentValue);

or

TRACE_TIME_START("MyTiming");
DoSomething();
TRACE_TIME_END("MyTiming")

Output would be (if switched on):

Description/Min/Max/Avg/#Traces
--------------------------------
MyTracedValue 4 20 6.23 200000
MyTiming 234msecs 4504msecs 405msec 200000

Discussion