2020-03-31 18:36:58 +01:00
|
|
|
#ifndef TIME_H_
|
|
|
|
|
#define TIME_H_
|
|
|
|
|
|
2022-05-10 18:25:11 +01:00
|
|
|
#include <stddef.h>
|
2020-03-31 18:36:58 +01:00
|
|
|
#include <sys/types.h>
|
2022-05-10 20:51:02 +01:00
|
|
|
#include <sys/time.h>
|
2022-05-10 18:25:11 +01:00
|
|
|
#include <sys/_time.h>
|
|
|
|
|
|
2022-05-12 15:15:54 +01:00
|
|
|
#define CLOCKS_PER_SEC __SYS_CLOCKS_PER_SEC
|
|
|
|
|
#define CLOCK_REALTIME __SYS_CLOCK_REALTIME
|
|
|
|
|
#define CLOCK_MONOTONIC __SYS_CLOCK_MONOTONIC
|
2020-03-31 18:36:58 +01:00
|
|
|
|
|
|
|
|
struct timespec {
|
|
|
|
|
time_t tv_sec;
|
|
|
|
|
long tv_nsec;
|
|
|
|
|
};
|
|
|
|
|
|
2022-05-10 18:25:11 +01:00
|
|
|
struct tm {
|
|
|
|
|
int tm_sec;
|
|
|
|
|
int tm_min;
|
|
|
|
|
int tm_hour;
|
|
|
|
|
int tm_mday;
|
|
|
|
|
int tm_mon;
|
|
|
|
|
int tm_year;
|
|
|
|
|
int tm_wday;
|
|
|
|
|
int tm_yday;
|
|
|
|
|
int tm_isdst;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
extern clock_t clock(void);
|
|
|
|
|
extern time_t time(time_t *p);
|
|
|
|
|
|
2022-05-26 11:47:10 +01:00
|
|
|
extern int nanosleep(const struct timespec *req, struct timespec *rem);
|
|
|
|
|
|
2022-05-10 18:25:11 +01:00
|
|
|
extern struct tm *gmtime(const time_t *timer);
|
|
|
|
|
extern struct tm *localtime(const time_t *timer);
|
|
|
|
|
extern time_t mktime(struct tm *timeptr);
|
|
|
|
|
extern size_t strftime(char *str, size_t max, const char *format, const struct tm *timeptr);
|
|
|
|
|
|
2022-05-10 20:51:02 +01:00
|
|
|
extern void tzset(void);
|
|
|
|
|
|
2022-05-12 15:15:54 +01:00
|
|
|
extern int clock_getres(clockid_t clk_id, struct timespec *res);
|
|
|
|
|
extern int clock_gettime(clockid_t clk_id, struct timespec *tp);
|
|
|
|
|
extern int clock_settime(clockid_t clk_id, const struct timespec *tp);
|
|
|
|
|
|
2020-03-31 18:36:58 +01:00
|
|
|
#endif
|