DABC (Data Acquisition Backbone Core)
2.9.9
|
Class for acquiring and holding timestamps. More...
#include <dabc/timing.h>
Public Member Functions | |
double | AsDouble () const |
Return time stamp in form of double (in seconds) More... | |
bool | Expired (const TimeStamp &curr, double interval) const |
Method returns true if specified time interval expired relative to time, kept in TimeStamp instance. More... | |
bool | Expired (double interval=0.) const |
Method returns true if specified time interval expired relative to time, kept in TimeStamp instance. More... | |
void | GetNow () |
Method to acquire current time stamp. More... | |
void | GetNow (double shift) |
Method to acquire current time stamp plus shift in seconds. More... | |
bool | null () const |
Returns true if time stamp is not initialized or its value less than 0. More... | |
double | operator() () const |
TimeStamp | operator+ (double _add) const |
TimeStamp & | operator+= (double _add) |
double | operator- (const TimeStamp &src) const |
TimeStamp | operator- (double _sub) const |
TimeStamp & | operator-= (double _sub) |
bool | operator< (const TimeStamp &src) const |
TimeStamp & | operator= (const TimeStamp &src) |
bool | operator== (const TimeStamp &src) const |
bool | operator> (const TimeStamp &src) const |
void | Reset () |
Set time stamp value to null. More... | |
double | SpentTillNow () const |
Method return time in second, spent from the time kept in TimeStamp instance If time was not set before, returns 0. More... | |
double | SpentTillNow (bool set_to_now) |
Method return time in second, spent from the time kept in TimeStamp instance If specified, automatically set to the current time If time was not set before, returns 0. More... | |
TimeStamp () | |
TimeStamp (const TimeStamp &src) | |
Static Public Member Functions | |
static TimeStamp | Now () |
Method returns TimeStamp instance with current time stamp value, measured either by fast TSC (if it is detected and working correctly), otherwise slow getclock() method will be used. More... | |
static void | SetUseSlow () |
Protected Types | |
typedef slowclock_t | fastclock_t |
typedef long long int | slowclock_t |
Protected Member Functions | |
TimeStamp (double v) | |
Static Protected Member Functions | |
static double | CalculateFastClockMult () |
static bool | CheckLinuxTSC () |
static TimeStamp | Fast () |
Method returns TimeStamp instance with current time, measure by fast TSC clock. More... | |
static fastclock_t | GetFastClock () |
static slowclock_t | GetSlowClock () |
static TimeStamp | Slow () |
Method returns TimeStamp instance with current time, measured by 'slow' getclock() function. More... | |
Protected Attributes | |
double | fValue |
time since start of the application in seconds More... | |
Static Protected Attributes | |
static bool | gFast = false |
indicates if fast or slow method is used for time measurement More... | |
static double | gFastClockMult = CalculateFastClockMult() |
static fastclock_t | gFastClockZero = dabc::TimeStamp::GetFastClock() |
static slowclock_t | gSlowClockZero = dabc::TimeStamp::GetSlowClock() |
Friends | |
class | Profiler |
Class for acquiring and holding timestamps.
Time measurement is done in seconds relative to program start. In normal case constant tsc counter is used - by program start during 0.1 seconds value of tsc counter compared with normal monolitic clock. If deviation is less than 0.01%, tsc counter will be used for the measurement, otherwise normal standard getclock. Major difference is performance. TSC counter can be read within 20 nanosec while getclock call takes about 300 ns. Before usage of TSC it is checked that constant_tsc is supported by the CPU looking in /proc/cpuinfo file.
|
protected |
|
protected |
|
staticprotected |
Definition at line 31 of file timing.cxx.
|
inlinestaticprotected |
|
staticprotected |
Definition at line 39 of file timing.cxx.
|
staticprotected |
Definition at line 102 of file timing.cxx.
|
inlinestaticprotected |
|
inlinestaticprotected |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
protected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |