struct timespec represents a time interval or timestamp with integral seconds and fractional nanoseconds. Its tv_nsec member supplies precision beyond time_t, whose granularity is seconds. section 8.5
Obtaining a precise timestamp
struct timespec ts;\ntimespec_get(&ts, TIME_UTC);\n\nThe timespec_get call writes the result into ts. TIME_UTC is the only base defined by the C standard, and its result should be consistent with time. section 8.5
Keep these distinctions in mind:
- Use struct timespec when second-level precision is insufficient. section 8.5
- Platform-specific base values may designate clocks other than wall-clock time, including monotonic or processor-time clocks. section 8.5

