MicrOS
time.h
Go to the documentation of this file.
1 #ifndef TIME_H
2 #define TIME_H
3 
5 #define CLOCKS_PER_SEC 1000
6 
7 #include <stdint.h>
8 #include "micros.h"
9 
11 typedef uint32_t clock_t;
12 
14 typedef uint64_t time_t;
15 
17 typedef struct tm
18 {
21 
24 
27 
30 
33 
36 
39 
42 
45 } tm;
46 
48 extern tm converted_time;
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
55 
59 clock_t clock();
60 
62 
68 double difftime(time_t end, time_t beginning);
69 
71 
76 time_t mktime(tm * timeptr);
77 
79 
84 time_t time(time_t* timer);
85 
87 
92 tm *gmtime(const time_t *timer);
93 
95 
103 
105 
113 
114 #ifdef __cplusplus
115 }
116 #endif
117 
118 #endif
uint32_t tm_yday
Days since January 1.
Definition: time.h:41
uint32_t tm_wday
Days since Sunday.
Definition: time.h:38
uint32_t __time_get_day_of_year(uint32_t day, uint32_t month, uint32_t year)
Calculates time of the year.
Definition: __time_get_day_of_year.c:3
uint64_t time_t
Time type.
Definition: time.h:14
time_t mktime(tm *timeptr)
Convert tm structure to time_t.
Definition: mktime.c:3
uint32_t clock_t
Clock type.
Definition: time.h:11
uint32_t __time_get_day_of_week(uint32_t day, uint32_t month, uint32_t year)
Calculates time of the week.
Definition: __time_get_day_of_week.c:3
uint32_t tm_isdst
Daylight Saving Time flag.
Definition: time.h:44
time_t time(time_t *timer)
Get current time.
Definition: time.c:5
uint32_t tm_min
Minutes after the hour.
Definition: time.h:23
uint32_t tm_year
Years since 1900.
Definition: time.h:35
double difftime(time_t end, time_t beginning)
Return difference between two times.
Definition: difftime.c:3
tm converted_time
Internal variable used during time conversions.
Definition: time.c:3
Time structure.
Definition: time.h:17
uint32_t tm_sec
Seconds after the minute.
Definition: time.h:20
uint32_t tm_mon
Months since January.
Definition: time.h:32
uint32_t tm_hour
Hours since midnight.
Definition: time.h:26
tm * gmtime(const time_t *timer)
Convert time_t to tm as UTC time.
Definition: gmtime.c:5
size_t uint32_t
Unsigned integral type.
Definition: string.h:8
uint32_t tm_mday
Day of the month.
Definition: time.h:29
clock_t clock()
Clock program.
Definition: clock.c:3