Public Member Functions

perf::Timer Class Reference
[Performance Timers API]

Timer class -- just throw one of these on the stack with a unique name. More...

#include <perf.h>

Collaboration diagram for perf::Timer:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Timer (const char *name)
 ~Timer (void)

Detailed Description

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.


Constructor & Destructor Documentation

perf::Timer::Timer ( const char *  name  ) 

The documentation for this class was generated from the following files: