Timer class -- just throw one of these on the stack with a unique name. More...
#include <perf.h>
Public Member Functions | |
Timer (const char *name) | |
~Timer (void) |
Timer class -- just throw one of these on the stack with a unique name.
When the timer destructs, it will register the time. At the end of program execution (actually, at any time!) you can call getTimingSummary() and retrieve the list of all timers encountered and basic statistics.
Example:
void myFunction(void) { perf::Timer timer("myFunction"); dosomething(); dosomething_else(); { perf::Timer timer("myFunction--expensive"); dosomething_expensive(); } }
Definition at line 174 of file perf.h.
perf::Timer::Timer | ( | const char * | name | ) |