Requires:
- to define
Profiler::ProfileMap Profiler::_profile;
somewhere - to scope blocks of code with
{ Profiler p("block label"); ... }
; do not use an anonymous variable otherwise the timer will be wrong as anonymous object will be deleted at the end of the instruction (see http://stackoverflow.com/a/2298796/626278) - to call
Profiler::dump()
to dump profiling stats in /tmp/profile