EMA C++ Edition
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
List of all members
thomsonreuters::ema::access::GetTime Class Reference

GetTime class encapsulates functionality for efficiently obtaining relative time in various standard units of time. More...

Static Public Member Functions

Accessors
static TimeValue getSeconds ()
 
static TimeValue getMillis ()
 
static TimeValue getMicros ()
 
static TimeValue getNanos ()
 
static TimeValue getTicks ()
 
static double ticksPerSecond ()
 
static double ticksPerMilli ()
 
static double ticksPerMicro ()
 
static double ticksPerNano ()
 

Detailed Description

Interface for efficiently obtaining relative time in various standard units of time. Interfaces providing units of seconds, milli seconds, micro seconds, and nano seconds are provided. Depending on the platform, the implementation uses clock_gettime(), if available otherwise gettimeofday(), on Linux, and QueryPerformanceCounter() on Windows.

Note that using the nano seconds interface does not necessarily provide nano second resolution or granularity. The actual resolution will vary depending on platform and other hardware variables. An interface for units of ticks is also provided and gives the time in the smallest units of time and the highest resolution available for any given platform. However, the actual resolution for any interface can only be determined empirically.

Interfaces for obtaining the number of ticks per standard unit of time are provided. Interfaces for obtaining the absolute time in standard units from two relative times in ticks are provided.

Note taking the inverse of the number of ticks per standard unit of time can be used to determine the upper bound of the actual resolution in the same units of time.

Definition at line 49 of file GetTime.h.

Member Function Documentation

static TimeValue thomsonreuters::ema::access::GetTime::getMicros ( )
static

Retrieve current time value in microseconds.

Returns
current time value in microseconds
static TimeValue thomsonreuters::ema::access::GetTime::getMillis ( )
static

Retrieve current time value in milliseconds.

Returns
current time value in milliseconds
static TimeValue thomsonreuters::ema::access::GetTime::getNanos ( )
static

Retrieve current time value in nanoseconds.

Returns
current time value in nanoseconds
static TimeValue thomsonreuters::ema::access::GetTime::getSeconds ( )
static

Retrieve current time value in seconds.

Returns
current time value in seconds
static TimeValue thomsonreuters::ema::access::GetTime::getTicks ( )
static

Retrieve current time value in CPU ticks. For Operating Systems that support monotonic clock implementations, this is in nanoseconds.

Returns
current time value in CPU ticks
static double thomsonreuters::ema::access::GetTime::ticksPerMicro ( )
static

Retrieve number of ticks per microsecond. This can be used with GetTime::getTicks().

Returns
number of ticks per microsecond
static double thomsonreuters::ema::access::GetTime::ticksPerMilli ( )
static

Retrieve number of ticks per millisecond. This can be used with GetTime::getTicks().

Returns
number of ticks per millisecond
static double thomsonreuters::ema::access::GetTime::ticksPerNano ( )
static

Retrieve number of ticks per nanosecond. This can be used with GetTime::getTicks().

Returns
number of ticks per nanosecond
static double thomsonreuters::ema::access::GetTime::ticksPerSecond ( )
static

Retrieve number of ticks per second. This can be used with GetTime::getTicks().

Returns
number of ticks per second