gatb.core-API-0.0.0
TimeCycle Class Reference

Implementation of ITime interface. More...

#include <TimeCommon.hpp>

Inheritance diagram for TimeCycle:
Inheritance graph

Public Member Functions

 TimeCycle ()
 
Value getTimeStamp ()
 
double getClockFrequency ()
 
- Public Member Functions inherited from TimeAbstract
 TimeAbstract (Unit unit)
 
Unit getUnit ()
 
std::string getDateString ()
 
- Public Member Functions inherited from ITime
virtual ~ITime ()
 

Additional Inherited Members

- Public Types inherited from ITime
typedef u_int64_t Value
 

Detailed Description

Implementation of ITime interface.

This implementation tries to use a precise hardware time counter, known as the Time Stamp Counter. It is then possible to get time stamps as number of clock cycles which provides a great accuracy.

Note that we use a third party library for this (see Agner Fog's work) providing a assembler coded function that returns the time stamp counter value.

Constructor & Destructor Documentation

TimeCycle ( )
inline

Constructor

Member Function Documentation

double getClockFrequency ( )
inline
Returns
an estimation of the CPU clock frequency in GHz.
Value getTimeStamp ( )
inlinevirtual

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.

Implements ITime.


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