-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtimespec.h
31 lines (24 loc) · 838 Bytes
/
timespec.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// SPDX-License-Identifier: MIT
#ifndef IOUCONTEXT_TIMESPEC_H
#define IOUCONTEXT_TIMESPEC_H
#include <limits.h>
#include <stdbool.h>
#include <sys/time.h>
#ifdef __cplusplus
extern "C" {
#endif
static const struct timespec timespec_block = { .tv_sec = -1, };
static const struct timespec timespec_zero = { .tv_sec = 0, .tv_nsec = 0, };
struct timespec reify_timespec(const struct timespec);
struct timespec normalize_timespec(const struct timespec);
struct timespec timespec_from_double(double);
double double_from_timespec(const struct timespec);
int timespec_when(const struct timespec);
bool timespec_past(const struct timespec);
bool timespec_present(const struct timespec);
bool timespec_future(const struct timespec);
bool timespec_normalized(const struct timespec);
#ifdef __cplusplus
}
#endif
#endif//IOUCONTEXT_TIMESPEC_H