|
BRL-CAD
|
Cross platform wrapper for timing functionality. More...
Files | |
| file | datetime.h |
Functions | |
| int64_t | bu_gettime (void) |
| int64_t | bu_timer_cpu (void) |
| int64_t | bu_timer_cpu_thread (void) |
| void | bu_utctime (struct bu_vls *utc_result, const int64_t time_val) |
Cross platform wrapper for timing functionality.
Returns a microsecond-accurate wall-clock time counter.
Example use:
Returns a high-resolution CPU (user+system) time counter for the current process, in nanoseconds.
Unlike bu_gettime(), this value is not a wall-clock or epoch timestamp. It measures CPU time consumed by the process across all threads. Returns -1 if a process CPU timer is not available on the platform.
Returns a high-resolution CPU (user+system) time counter for the current thread, in nanoseconds.
This is useful for profiling small regions of threaded work without charging scheduler preemption or other threads' work to the measured interval. Returns -1 if a current-thread CPU timer is not available on the platform.
Evaluate the time_t input as UTC time in ISO format.
The UTC time is written into the user-provided bu_vls struct and is also returned and guaranteed to be a non-null result, returning a static "NULL" UTC time if an error is encountered.