This is a simple thread-safe tool for counting time spent in various chunks of code. This is different from external profiling tools in that it allows the user to count time spent in various bits of code (sub-function granularity) or count how many times certain pieces of code are executed. More...
#include <Profiler.h>
Classes | |
class | BeginBlock |
This instance will call Profiler::begin() when constructed and Profiler::end() when it goes out of scope. More... | |
struct | PerThread |
Timing information to be maintained for each thread. | |
struct | TimeInfo |
Information about time spent in a section of the code. | |
Public Member Functions | |
Profiler (bool printOnDestroy=false, bool autoStart=false) | |
Constructor. It is allowed to separately instantiate this class (not only as a singleton) | |
~Profiler (void) | |
Destructor. | |
void | start (void) |
Start counting time. | |
void | stop (void) |
Stop counting time. | |
void | clear (void) |
Clear counted time and events. | |
void | event (const std::string &name, const unsigned int times=1) |
Count a specific event for a number of times. | |
void | begin (const std::string &name) |
Begin counting time for a specific chunk of code. | |
void | end (const std::string &name) |
Stop counting time for a specific chunk of code. | |
void | status (std::ostream &out=std::cout, bool merge=true) |
Print the status of the profiled code chunks and events. Optionally, computation done by different threads can be printed separately. | |
void | console (void) |
Print the status of the profiled code chunks and events to the console (using msg::Console) | |
Static Public Member Functions | |
static Profiler & | Instance (void) |
Return an instance of the class. | |
static void | Start (void) |
Start counting time. | |
static void | Stop (void) |
Stop counting time. | |
static void | Clear (void) |
Clear counted time and events. | |
static void | Event (const std::string &name, const unsigned int times=1) |
Count a specific event for a number of times. | |
static void | Begin (const std::string &name) |
Begin counting time for a specific chunk of code. | |
static void | End (const std::string &name) |
Stop counting time for a specific chunk of code. | |
static void | Status (std::ostream &out=std::cout, bool merge=true) |
Print the status of the profiled code chunks and events. Optionally, computation done by different threads can be printed separately. | |
static void | Console (void) |
Print the status of the profiled code chunks and events to the console (using msg::Console) |
This is a simple thread-safe tool for counting time spent in various chunks of code. This is different from external profiling tools in that it allows the user to count time spent in various bits of code (sub-function granularity) or count how many times certain pieces of code are executed.
Definition at line 75 of file Profiler.h.
ompl::Profiler & ompl::Profiler::Instance | ( | void | ) | [static] |
Return an instance of the class.
Definition at line 40 of file Profiler.cpp.