Quick Links:

bal | bbl | bdl | bsl

Static Public Member Functions

bsls::TimeUtil Struct Reference

#include <bsls_timeutil.h>

List of all members.

Static Public Member Functions

static void initialize ()
static Types::Int64 convertRawTime (OpaqueNativeTime rawTime)
static Types::Int64 getProcessSystemTimer ()
static void getProcessTimers (Types::Int64 *systemTimer, Types::Int64 *userTimer)
static Types::Int64 getProcessUserTimer ()
static Types::Int64 getTimer ()
static void getTimerRaw (OpaqueNativeTime *timeValue)

Detailed Description

This struct provides a namespace for a set of platform-neutral pure procedures to access real-time system clock functionality. High-resolution time functions intended for interval-timing return an interval in nanoseconds (1 nsec = 1E-9 sec) as a platform-independent 64-bit integer.

For maximum performance on some platforms where fetching the native clock is significantly faster than converting the fetched value to nanoseconds, this class also provides a "raw" method returning an opaque native time value and a conversion method returning a value in nanoseconds.

See Component bsls_timeutil


Member Function Documentation

static void bsls::TimeUtil::initialize (  )  [static]

Do a platform-dependent initialization for the utilities. Note that the other methods in this component are guaranteed to be thread-safe only after calling this method.

static Types::Int64 bsls::TimeUtil::convertRawTime ( OpaqueNativeTime  rawTime  )  [static]

Convert the specified rawTime to a value in nanoseconds, referenced to an arbitrary but fixed origin, and return the result of the conversion. Note that this method is thread-safe only if initialize has been called before.

static Types::Int64 bsls::TimeUtil::getProcessSystemTimer (  )  [static]

Return the instantaneous values of a platform-dependent timer for the current process system time in absolute nanoseconds referenced to an arbitrary but fixed origin. Note that this method is thread- safe only if initialize has been called before.

static void bsls::TimeUtil::getProcessTimers ( Types::Int64 systemTimer,
Types::Int64 userTimer 
) [static]

Load into the specified systemTimer and userTimer the instantaneous values of platform-dependent system timer and user timer in absolute nanoseconds referenced to an arbitrary but fixed origin. Note that this method is thread-safe only if initialize has been called before.

static Types::Int64 bsls::TimeUtil::getProcessUserTimer (  )  [static]

Return the instantaneous values of a platform-dependent timer for the current process user time in absolute nanoseconds referenced to an arbitrary but fixed origin. Note that this method is thread-safe only if initialize has been called before.

static Types::Int64 bsls::TimeUtil::getTimer (  )  [static]

Return the instantaneous value of a platform-dependent system timer in absolute nanoseconds referenced to an arbitrary but fixed origin. Note that this method is thread-safe only if initialize has been called before.

static void bsls::TimeUtil::getTimerRaw ( OpaqueNativeTime *  timeValue  )  [static]

Load into the specified timeValue the value of an opaque, platform-dependent type representing the current time. timeValue must be converted by the convertRawTime method to conventional units (nanoseconds). This method is intended to facilitate accurate timing of small segments of code, and care must be used in interpreting the results. Note that this method is thread-safe only if initialize has been called before.


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