1timespec(3type) timespec(3type)
2
3
4
6 timespec - time in seconds and nanoseconds
7
9 Standard C library (libc)
10
12 #include <time.h>
13
14 struct timespec {
15 time_t tv_sec; /* Seconds */
16 /* ... */ tv_nsec; /* Nanoseconds [0, 999'999'999] */
17 };
18
20 Describes times in seconds and nanoseconds.
21
22 tv_nsec is of an implementation-defined signed type capable of holding
23 the specified range. Under glibc, this is usually long, and long long
24 on X32. It can be safely down-cast to any concrete 32-bit integer type
25 for processing.
26
28 Prior to C23, tv_nsec was long.
29
31 C11, POSIX.1-2008.
32
34 POSIX.1-2001.
35
37 The following headers also provide this type: <aio.h>, <mqueue.h>,
38 <sched.h>, <signal.h>, <sys/select.h>, and <sys/stat.h>.
39
41 clock_gettime(2), clock_nanosleep(2), nanosleep(2), timerfd_gettime(2),
42 timer_gettime(2), time_t(3type), timeval(3type)
43
44
45
46Linux man-pages 6.04 2023-03-30 timespec(3type)