27 #error "Do not include this file directly. Use <time.h> instead."
40#define __STDC_VERSION_TIME_H__ 202311L
43#define _CLOCKS_PER_SEC_ 1000000
46#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)) || \
47 (defined(__cplusplus) && (__cplusplus >= 201703L))
54extern int timespec_get(
struct timespec *ts,
int base);
58#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202000L)) || \
59 (defined(__cplusplus) && (__cplusplus > 202002L)) || \
63#define TIME_MONOTONIC 2
65#define TIME_THREAD_ACTIVE 4
68extern int timespec_getres(
struct timespec *ts,
int base);
72#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202300L)
76[[deprecated]]
extern char *asctime(
const struct tm *timeptr);
77[[deprecated]]
extern char *ctime(
const __time_t *timer);
81#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202300L)) || \
82 (defined(__cplusplus) && (__cplusplus > 202002L)) || \
87extern struct tm *gmtime_r(
const __time_t *timer,
struct tm *timeptr);
88extern struct tm *localtime_r(
const __time_t *timer,
struct tm *timeptr);
91extern __time_t timegm(
struct tm *timeptr);
96#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 199309L)
103#ifndef _POSIX_MONOTONIC_CLOCK
104#define _POSIX_MONOTONIC_CLOCK 1
107#ifndef _POSIX_CPUTIME
108#define _POSIX_CPUTIME 1
111#ifndef _POSIX_THREAD_CPUTIME
112#define _POSIX_THREAD_CPUTIME 1
118extern int clock_settime(__clockid_t clock_id,
const struct timespec *ts);
119extern int clock_gettime(__clockid_t clock_id,
struct timespec *ts);
120extern int clock_getres(__clockid_t clock_id,
struct timespec *res);
122extern int nanosleep(
const struct timespec *req,
struct timespec *rem);
Various common macros used throughout the codebase.