OSAPI  0.29
Open System API
common_type_time.h
1 // *****************************************************************************************
2 //
3 // File description:
4 //
5 // Author: Joao Costa
6 // Purpose: Common declarations for a time type
7 //
8 // *****************************************************************************************
9 
10 #ifndef OSAPI_COMMON_TYPE_TIME_H_
11 #define OSAPI_COMMON_TYPE_TIME_H_
12 
13 // *****************************************************************************************
14 //
15 // Section: Import headers
16 //
17 // *****************************************************************************************
18 
19 // System headers
20 #include <stdint.h>
21 
22 // Import OSAPI headers
23 
24 // Include own headers
25 
26 
27 // *****************************************************************************************
28 //
29 // Section: Type definitions
30 //
31 // *****************************************************************************************
32 
34 enum osapi_common_time_precision_E
35 {
36  osapi_time_unspecified = 0,
37  osapi_time_second ,
38  osapi_time_tsecond ,
39  osapi_time_hsecond ,
40  osapi_time_milli ,
41  osapi_time_tmilli ,
42  osapi_time_hmilli ,
43  osapi_time_micro ,
44  osapi_time_tmicro ,
45  osapi_time_hmicro ,
46  osapi_time_nano ,
47  osapi_time_tnano ,
48  osapi_time_hnano ,
49  osapi_time_pico ,
50  osapi_time_femto ,
51  osapi_time_atto ,
52  osapi_time_zepto ,
53  osapi_time_yocto ,
54  osapi_time_planck ,
55 
56  osapi_time_minute ,
57  osapi_time_hour
58 
59 };
60 
61 typedef enum osapi_common_time_precision_E t_time_precision;
62 
63 
66 {
67  int64_t seconds;
68  uint64_t fraction;
69  t_time_precision precision;
70 };
71 
72 typedef struct osapi_time_S t_time;
73 
74 
75 #endif /* OSAPI_COMMON_TYPE_TIME_H_ */
osapi_time_S
Structure supporting a time date.
Definition: common_type_time.h:65
osapi_time_S::seconds
int64_t seconds
Seconds since the Epoch (UNIX time)
Definition: common_type_time.h:67
osapi_time_S::fraction
uint64_t fraction
Fraction of a second.
Definition: common_type_time.h:68
osapi_time_S::precision
t_time_precision precision
Time resolution.
Definition: common_type_time.h:69