TIMESPEC_GET(3C) Standard C Library Functions TIMESPEC_GET(3C)

timespec_get
get time information

#include <time.h>

int
timespec_get(struct timespec *ts, int base);

The timespec_get() function provides access nanosecond resolution time. The meaning and source of time is defined by the base argument. The following values are defined for base:
TIME_UTC
Obtain the current time of day from the realtime clock on the system. It represents the amount of time in second and nanoseconds since the Epoch. This is logically equivalent to calling clock_gettime(3C) with CLOCK_REALTIME.

For the definition of the timespec structure, see time.h(3HEAD).

Upon successful completion, the timespec_get() function returns the passed in value of base. Otherwise, 0 is returned to represent an error.

Unlike other functions, the timespec_get() function is not defined to set errno. However, the timespec_get() function will fail if:

Standard

MT-Safe

clock_gettime(3C), time.h(3HEAD), attributes(7)
March 25, 2016 OmniOS