gatb.core-API-0.0.0
|
Tool for time statistics. More...
#include <TimeInfo.hpp>
Public Member Functions | |
TimeInfo () | |
TimeInfo (system::ITime &aTime) | |
virtual void | start (const char *name) |
virtual void | stop (const char *name) |
TimeInfo & | operator+= (TimeInfo &ti) |
TimeInfo & | operator/= (size_t nb) |
const std::map< std::string, u_int32_t > & | getEntries () |
u_int32_t | getEntryByKey (const std::string &key) |
double | get (const std::string &key) |
virtual tools::misc::IProperties * | getProperties (const std::string &root) |
Public Member Functions inherited from SmartPointer | |
void | use () |
void | forget () |
Public Member Functions inherited from ISmartPointer | |
virtual | ~ISmartPointer () |
Additional Inherited Members | |
Protected Member Functions inherited from SmartPointer | |
SmartPointer () | |
virtual | ~SmartPointer () |
Tool for time statistics.
This class provides methods for getting time information between two execution points.
One can use a label for getting a specific time duration; it is possible later to get this duration by giving the label.
Example of use:
TimeInfo | ( | ) |
Default constructor.
TimeInfo | ( | system::ITime & | aTime | ) |
Constructor taking a time factory.
[in] | aTime | : the time factory to be used. |
|
inline |
Retrieve the duration for a given label in seconds
[in] | key | : the label we want the duration for. |
const std::map< std::string, u_int32_t > & getEntries | ( | ) |
Provides (as a map) all got durations for each known label/
u_int32_t getEntryByKey | ( | const std::string & | key | ) |
Retrieve the duration for a given label.
[in] | key | : the label we want the duration for. |
|
virtual |
Creates and return as a IProperties instance the whole timing information.
[in] | root | : root name of the properties to be returned. |
Merge the content of the current time info with the provided one.
[in] | ti | : info to merged. |
TimeInfo & operator/= | ( | size_t | nb | ) |
Didive the time (useful when gathered times from several threads).
[in] | nb | : divisor. |
|
virtual |
Get the start time for a given label.
[in] | name | : the label |
|
virtual |
Get the stop time for a given label.
[in] | name | : the label |