JeVois  1.5
JeVois Smart Embedded Machine Vision Toolkit
Share this page:
jevois::Profiler Class Reference

#include <jevois/Debug/Profiler.H>

Simple profiler class.

This class reports the time spent between start() and each of the checkpoint() calls, separately computed for each checkpoint string, at specified intervals. Because JeVois modules typically work at video rates, this class only reports the average time after some number of iterations through the start(), checkpoint(), and stop(). Thus, even if the time between two checkpoints is only a few microseconds, by reporting it only every 100 frames one will not slow down the overall framerate too much. See Timer for a lighter class with only start() and stop().

Definition at line 34 of file Profiler.H.

Public Member Functions

 Profiler (char const *prefix, size_t interval=100, int loglevel=LOG_INFO)
 Constructor. More...
 
void start ()
 Start a time measurement period. More...
 
void checkpoint (char const *description)
 Note the time for a particular event. More...
 
void stop ()
 End a time measurement period, report time spent for each checkpoint if reporting interval is reached. More...
 

Constructor & Destructor Documentation

◆ Profiler()

jevois::Profiler::Profiler ( char const *  prefix,
size_t  interval = 100,
int  loglevel = LOG_INFO 
)

Constructor.

Definition at line 34 of file Profiler.C.

References LFATAL.

Member Function Documentation

◆ checkpoint()

void jevois::Profiler::checkpoint ( char const *  description)

Note the time for a particular event.

The delta time between this event and the previous one (or start() for the first checkpoint) will be reported. Note that we create a new unique entry in our tables for each description value, so you should keep the number of unique descriptions passed small (do not include a frame number or some parameter value). The description is passed as a raw C string to encourage you to just use a string literal for it.

Definition at line 49 of file Profiler.C.

Referenced by BOOST_PYTHON_MODULE().

◆ start()

void jevois::Profiler::start ( )

Start a time measurement period.

Definition at line 43 of file Profiler.C.

Referenced by BOOST_PYTHON_MODULE().

◆ stop()

void jevois::Profiler::stop ( )

End a time measurement period, report time spent for each checkpoint if reporting interval is reached.

The time reported is from start to each checkpoint.

Definition at line 84 of file Profiler.C.

References LDEBUG, LERROR, LFATAL, and LINFO.

Referenced by BOOST_PYTHON_MODULE().


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