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

NAME


timespec_get - get time information

SYNOPSIS


#include <time.h>

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

DESCRIPTION


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).

RETURN VALUES


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

ERRORS


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

+o The value of base does not refer to a known time specification.

+o There was an error obtaining the time for base.

INTERFACE STABILITY


Standard

MT-LEVEL
MT-Safe

SEE ALSO


clock_gettime(3C), time.h(3HEAD), attributes(7)

OmniOS March 25, 2016 OmniOS