GetTime class encapsulates functionality for efficiently obtaining relative time in various standard units of time. More...
Accessors | |
static TimeValue | getSeconds () |
More... | |
static TimeValue | getMillis () |
More... | |
static TimeValue | getMicros () |
More... | |
static TimeValue | getNanos () |
More... | |
static TimeValue | getTicks () |
More... | |
static double | ticksPerSecond () |
More... | |
static double | ticksPerMilli () |
More... | |
static double | ticksPerMicro () |
More... | |
static double | ticksPerNano () |
More... | |
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.
|
static |
Retrieve current time value in microseconds.
|
static |
Retrieve current time value in milliseconds.
|
static |
Retrieve current time value in nanoseconds.
|
static |
Retrieve current time value in seconds.
|
static |
Retrieve current time value in CPU ticks. For Operating Systems that support monotonic clock implementations, this is in nanoseconds.
|
static |
Retrieve number of ticks per microsecond. This can be used with GetTime::getTicks().
|
static |
Retrieve number of ticks per millisecond. This can be used with GetTime::getTicks().
|
static |
Retrieve number of ticks per nanosecond. This can be used with GetTime::getTicks().
|
static |
Retrieve number of ticks per second. This can be used with GetTime::getTicks().
![]() |
![]() |
|