ocra-recipes
Doxygen documentation for the ocra-recipes repository
|
To get and save time information to collect some data on performances. More...
#include <Performances.h>
Public Member Functions | |
PerformanceRecorder () | |
virtual | ~PerformanceRecorder () |
double | getCurrentTime () |
void | initializeTime () |
void | saveRelativeTime () |
double | getRelativeTime () |
void | saveTime (double t) |
const std::list< double > & | getSavedTime () const |
void | writeInStream (const std::string &headerName, std::ostream &outstream, bool addCommaAtEnd) |
Protected Attributes | |
timeval | tim |
double | _initTime |
std::list< double > | _record |
To get and save time information to collect some data on performances.
It can be used in two ways. First to save a timeline:
Or to save loop performances:
Definition at line 65 of file wocra/include/wocra/Performances.h.
|
inline |
Create a performance recorder. It also initializes the internal initial time.
Definition at line 72 of file wocra/include/wocra/Performances.h.
|
inlinevirtual |
Destructor
Definition at line 77 of file wocra/include/wocra/Performances.h.
|
inline |
Get the current time.
It calls method "gettimeofday" and returns a value representing the current time of the day in second.
Definition at line 83 of file wocra/include/wocra/Performances.h.
|
inline |
get the relative elapsed time since the time reference, i.e. the last call of initializeTime().
Definition at line 108 of file wocra/include/wocra/Performances.h.
|
inline |
Get the list where are saved the relative times.
Definition at line 120 of file wocra/include/wocra/Performances.h.
|
inline |
Initialize internal Zero time.
It calls method getCurrentTime() to get a time reference.
Definition at line 92 of file wocra/include/wocra/Performances.h.
|
inline |
Save the relative elapsed time since the time reference, i.e. the last call of initializeTime().
The value is saved in a list available with getSavedTime() const
Definition at line 100 of file wocra/include/wocra/Performances.h.
|
inline |
Definition at line 112 of file wocra/include/wocra/Performances.h.
|
inline |
Save performances information in a output stream.
headerName | The name of the performance saved in the |
outstream | the output stream where to write the performances information |
addCommaAtEnd | If true, add a comma at the end of the stream. If false, it means that this is the end of the json file, nothing will be added after that, no comma is added. |
Definition at line 130 of file wocra/include/wocra/Performances.h.
|
protected |
Definition at line 149 of file wocra/include/wocra/Performances.h.
|
protected |
Definition at line 151 of file wocra/include/wocra/Performances.h.
|
protected |
Definition at line 147 of file wocra/include/wocra/Performances.h.