Profiler.h
85 ScopedBlock(const std::string &name, Profiler &prof = Profiler::Instance()) : name_(name), prof_(prof)
void end(const std::string &name)
Stop counting time for a specific chunk of code.
static void Console()
Print the status of the profiled code chunks and events to the console (using msg::Console)
Definition: Profiler.h:221
static void Average(const std::string &name, const double value)
Maintain the average of a specific value.
Definition: Profiler.h:180
ScopedStart(Profiler &prof=Profiler::Instance())
Take as argument the profiler instance to operate on (prof)
Definition: Profiler.h:107
This is a simple thread-safe tool for counting time spent in various chunks of code....
Definition: Profiler.h:72
void console()
Print the status of the profiled code chunks and events to the console (using msg::Console)
This instance will call Profiler::start() when constructed and Profiler::stop() when it goes out of s...
Definition: Profiler.h:103
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 th...
Definition: Profiler.h:209
void average(const std::string &name, const double value)
Maintain the average of a specific value.
std::chrono::system_clock::duration duration
Representation of a time duration.
Definition: Time.h:119
static void End(const std::string &name)
Stop counting time for a specific chunk of code.
Definition: Profiler.h:195
static void Begin(const std::string &name)
Begin counting time for a specific chunk of code.
Definition: Profiler.h:189
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 th...
static void Event(const std::string &name, const unsigned int times=1)
Count a specific event for a number of times.
Definition: Profiler.h:171
ScopedBlock(const std::string &name, Profiler &prof=Profiler::Instance())
Start counting time for the block named name of the profiler prof.
Definition: Profiler.h:85
This instance will call Profiler::begin() when constructed and Profiler::end() when it goes out of sc...
Definition: Profiler.h:81
void begin(const std::string &name)
Begin counting time for a specific chunk of code.
void event(const std::string &name, const unsigned int times=1)
Count a specific event for a number of times.
Profiler(bool printOnDestroy=false, bool autoStart=false)
Constructor. It is allowed to separately instantiate this class (not only as a singleton)
Definition: Profiler.h:129