[#BloombergLP-bsls-TimeUtil]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsls.adoc[bsls]::TimeUtil
:relfileprefix: ../../
:mrdocs:

This `struct` provides a namespace for platform&hyphen;neutral system&hyphen;clock procedures&period;

== Synopsis

Declared in `&lt;bsls&lowbar;timeutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct TimeUtil;
----

== Description

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

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 &quot;raw&quot; method returning an opaque native time value and a conversion method returning a value in nanoseconds&period;

== Type Aliases

[cols="1"]
|===
| Name
| xref:BloombergLP/bsls/TimeUtil/OpaqueNativeTime.adoc[`OpaqueNativeTime`] 
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bsls/TimeUtil/convertRawTime.adoc[`convertRawTime`] 
| Convert an opaque native time value to nanoseconds&period;
| xref:BloombergLP/bsls/TimeUtil/getProcessSystemTimer.adoc[`getProcessSystemTimer`] 
| Return the current process system CPU time in nanoseconds&period;
| xref:BloombergLP/bsls/TimeUtil/getProcessTimers.adoc[`getProcessTimers`] 
| Load the current process system and user CPU times in nanoseconds&period;
| xref:BloombergLP/bsls/TimeUtil/getProcessUserTimer.adoc[`getProcessUserTimer`] 
| Return the current process user CPU time in nanoseconds&period;
| xref:BloombergLP/bsls/TimeUtil/getThreadSystemTimer.adoc[`getThreadSystemTimer`] 
| Return the current thread system CPU time in nanoseconds&period;
| xref:BloombergLP/bsls/TimeUtil/getThreadTimers.adoc[`getThreadTimers`] 
| Load the current thread system and user CPU times in nanoseconds&period;
| xref:BloombergLP/bsls/TimeUtil/getThreadUserTimer.adoc[`getThreadUserTimer`] 
| Return the current thread user CPU time in nanoseconds&period;
| xref:BloombergLP/bsls/TimeUtil/getTimer.adoc[`getTimer`] 
| Return the current wall time in nanoseconds from a fixed origin&period;
| xref:BloombergLP/bsls/TimeUtil/getTimerRaw.adoc[`getTimerRaw`] 
| Load the current time as an opaque platform&hyphen;dependent value&period;
| xref:BloombergLP/bsls/TimeUtil/initialize.adoc[`initialize`] 
| Perform platform&hyphen;dependent initialization for these utilities&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
