JeVois  1.5
JeVois Smart Embedded Machine Vision Toolkit
Share this page:

#include <jevois/Debug/Timer.H>

Simple timer class.

This class reports the time spent between start() and stop(), at specified intervals. Because JeVois modules typically work at video rates, this class only reports the average time after some number of iterations through start() and stop(). Thus, even if the time of an operation between start() and stop() is only a few microseconds, by reporting it only every 100 frames one will not slow down the overall framerate too much. See Profiler for a class that provides additional checkpoints between start() and stop().

Definition at line 34 of file Timer.H.

Public Member Functions

 Timer (char const *prefix, size_t interval=100, int loglevel=LOG_INFO)
 Constructor. More...
 
void start ()
 Start a time measurement period. More...
 
std::string const & stop ()
 End a time measurement period, report time spent if reporting interval is reached. More...
 

Constructor & Destructor Documentation

◆ Timer()

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

Constructor.

Definition at line 39 of file Timer.C.

References LFATAL.

Member Function Documentation

◆ start()

void jevois::Timer::start ( )

Start a time measurement period.

Definition at line 50 of file Timer.C.

Referenced by BOOST_PYTHON_MODULE().

◆ stop()

std::string const & jevois::Timer::stop ( )

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

The fps and cpu load are returned, in case users want to show this info, eg, in an overlay display. Note that the values are only updated when the reporting interval is reached, and remain the same in between.

Definition at line 57 of file Timer.C.

References LDEBUG, LERROR, LFATAL, and LINFO.

Referenced by BOOST_PYTHON_MODULE().


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