BloombergLP::bsls::TimeUtil

This struct provides a namespace for platform-neutral system-clock procedures.

Synopsis

Declared in <bsls_timeutil.h>

struct TimeUtil;

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.

Type Aliases

Name
OpaqueNativeTime

Static Member Functions

NameDescription
convertRawTime Convert an opaque native time value to nanoseconds.
getProcessSystemTimer Return the current process system CPU time in nanoseconds.
getProcessTimers Load the current process system and user CPU times in nanoseconds.
getProcessUserTimer Return the current process user CPU time in nanoseconds.
getThreadSystemTimer Return the current thread system CPU time in nanoseconds.
getThreadTimers Load the current thread system and user CPU times in nanoseconds.
getThreadUserTimer Return the current thread user CPU time in nanoseconds.
getTimer Return the current wall time in nanoseconds from a fixed origin.
getTimerRaw Load the current time as an opaque platform-dependent value.
initialize Perform platform-dependent initialization for these utilities.