From f5571e2b3de348632256899858da589ba146c1f0 Mon Sep 17 00:00:00 2001 From: Lephenixnoir Date: Sun, 13 Jun 2021 18:26:04 +0200 Subject: [PATCH] time: add general definitions --- include/time.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 include/time.h diff --git a/include/time.h b/include/time.h new file mode 100644 index 0000000..63b755c --- /dev/null +++ b/include/time.h @@ -0,0 +1,26 @@ +#ifndef __TIME_H__ +# define __TIME_H__ + +/* Number of ticks per second in a clock_t value. */ +#define CLOCKS_PER_SEC 1000000 + +/* Type used to represent process CPU time; unit is CLOCKS_PER_SEC. */ +typedef uint64_t clock_t; + +/* Type used to represent a number of seconds since Epoch. */ +typedef uint64_t time_t; + +/* Broken-down time. */ +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; +}; + +#endif /*__TIME_H__*/