gatb.core-API-1.4.2
ITime Class Referenceabstract

Interface that provides methods returning time information. More...

#include <ITime.hpp>

Inheritance diagram for ITime:
Inheritance graph

Public Types

typedef u_int64_t Value
 

Public Member Functions

virtual Value getTimeStamp ()=0
 
virtual Unit getUnit ()=0
 
virtual std::string getDateString ()=0
 
virtual ~ITime ()
 

Detailed Description

Interface that provides methods returning time information.

This interface mainly defines an operation that returns a time stamp, according to the beginning of the current process.

The unit of the returned value may depend on the implementation. It could be second, millisecond and so on, or we can also use a unit independent of time, like the number of CPU cycles, which may be interesting for comparing the same test on different machines with different clock frequencies.

Member Typedef Documentation

typedef u_int64_t Value

Alias for the possible values for time stamping. Note that we use a large integer because we may have huge values in case we use the CPUCLOCK unit (for instance, value=2000000000 for one second with CPU frequency of 2 GHz).

Constructor & Destructor Documentation

virtual ~ITime ( )
inlinevirtual

Destructor.

Member Function Documentation

virtual std::string getDateString ( )
pure virtual

Get a string holding information about the current date.

Returns
the formatted date string.

Implemented in TimeAbstract.

virtual Value getTimeStamp ( )
pure virtual

Returns a time stamp, ie the number of time atoms (depending on chosen time unit) since some define T0 time. Such a starting time can be the 01.01.1970 for instance, or the beginning of the process. It implies that clients should be interested not in the absolute value returned by the method but by the distance between two such values.

Returns
elapsed time atoms number.

Implemented in TimeCycle, and TimeSystem.

virtual Unit getUnit ( )
pure virtual
Returns
the time unit used by getTimeStamp.

Implemented in TimeAbstract.


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