22#ifndef LELY_LIBC_TIME_H_
23#define LELY_LIBC_TIME_H_
29#ifndef LELY_HAVE_ITIMERSPEC
30#if defined(_POSIX_C_SOURCE) || defined(_POSIX_TIMERS) \
31 || defined(_TIMESPEC_DEFINED)
32#define LELY_HAVE_ITIMERSPEC 1
36#ifndef LELY_HAVE_TIMESPEC
37#if __STDC_VERSION__ >= 201112L || _MSC_VER >= 1900 \
38 || _POSIX_C_SOURCE >= 199309L || defined(__CYGWIN__) \
39 || defined(_TIMESPEC_DEFINED) || defined(__timespec_defined)
40#define LELY_HAVE_TIMESPEC 1
44#ifndef LELY_HAVE_TIMESPEC_GET
45#if (__STDC_VERSION__ >= 201112L || __USE_ISOC11 || _MSC_VER >= 1900) \
47#define LELY_HAVE_TIMESPEC_GET 1
51#if !defined(_POSIX_C_SOURCE) && !defined(_POSIX_TIMERS) \
52 && !defined(__MINGW32__)
56#define CLOCK_REALTIME 0
64#define CLOCK_MONOTONIC 1
70#define CLOCK_PROCESS_CPUTIME_ID 2
76#define CLOCK_THREAD_CPUTIME_ID 3
80#define TIMER_ABSTIME 1
85#if !LELY_HAVE_TIMESPEC
97#if !LELY_HAVE_ITIMERSPEC
113#if !defined(_POSIX_TIMERS) && !defined(__MINGW32__)
203#if !LELY_HAVE_TIMESPEC_GET
int timespec_get(struct timespec *ts, int base)
Sets the interval at ts to hold the current calendar time based on the specified time base.
A struct specifying an interval and initial value for a timer.
struct timespec it_interval
The timer period.
struct timespec it_value
The timer expiration.
A time type with nanosecond resolution.
long tv_nsec
Nanoseconds [0, 999999999].
time_t tv_sec
Whole seconds (>= 0).
This header file is part of the C11 and POSIX compatibility library; it includes <sys/types....
int clockid_t
Used for clock ID type in the clock and timer functions.
This header file is part of the utilities library; it contains the time function declarations.