Get the number of seconds and nanoseconds since a given epoch
#include <time.h>
int timespec_get( struct timespec *ts,
int base );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The timespec_get() function gets the number of seconds and nanoseconds since a given epoch. It's similar to calling clock_gettime(CLOCK_REALTIME, ts).
The given base, or 0 if an error occurred.
| Safety: | |
|---|---|
| Cancellation point | No |
| Interrupt handler | No |
| Signal handler | Yes |
| Thread | Yes |