JeVois
1.22
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().
Public Member Functions | |
Timer (char const *prefix, size_t interval=100, int loglevel=LOG_INFO) | |
Constructor. | |
void | start () |
Start a time measurement period. | |
std::string const & | stop (double *seconds) |
End a time measurement period, report time spent if reporting interval is reached. | |
std::string const & | stop () |
Same as the other signature of stop() except does not provide seconds, for python bindings. | |
jevois::Timer::Timer | ( | char const * | prefix, |
size_t | interval = 100 , |
||
int | loglevel = LOG_INFO |
||
) |
void jevois::Timer::start | ( | ) |
std::string const & jevois::Timer::stop | ( | ) |
std::string const & jevois::Timer::stop | ( | double * | seconds | ) |
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. If seconds is not null, it will be set to the instantaneous number of seconds between start() and stop().
Definition at line 47 of file Timer.C.
References LDEBUG, LERROR, LFATAL, LINFO, and jevois::secs2str().