BRL-CAD

Cross platform wrapper for microsecond accuracy timing functionality. More...

Collaboration diagram for Time Support:

Files

file  time.h
 

Functions

int64_t bu_gettime (void)
 
void bu_utctime (struct bu_vls *utc_result, const int64_t time_val)
 

Detailed Description

Cross platform wrapper for microsecond accuracy timing functionality.

Function Documentation

◆ bu_gettime()

int64_t bu_gettime ( void  )

Returns a microsecond-accurate wall-clock time counter.

Example use:

int64_t start = bu_gettime();
do_some_work_here();
double elapsed = bu_gettime() - start;
double seconds = elapsed / 1000000.0;
printf("time: %.2f\n", seconds);
int64_t bu_gettime(void)

◆ bu_utctime()

void bu_utctime ( struct bu_vls utc_result,
const int64_t  time_val 
)

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.