36 lines
671 B
C
36 lines
671 B
C
#ifndef TIME_H_
|
|
#define TIME_H_
|
|
|
|
#include <stddef.h>
|
|
#include <sys/types.h>
|
|
#include <sys/_time.h>
|
|
|
|
#define CLOCKS_PER_SEC __SYS_CLOCKS_PER_SEC
|
|
|
|
struct timespec {
|
|
time_t tv_sec;
|
|
long tv_nsec;
|
|
};
|
|
|
|
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);
|
|
|
|
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);
|
|
|
|
#endif
|