JeVois  1.0
JeVois Smart Embedded Machine Vision Toolkit

#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

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


Definition at line 39 of file Timer.C.

References LFATAL.

Member Function Documentation

void jevois::Timer::start ( )

Start a time measurement period.

Definition at line 50 of file Timer.C.

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.


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