Data Structures | |
struct | trtime |
Time structure. More... | |
Typedefs | |
typedef trtime | trtime_t |
Functions | |
LT_INLINE uint32_t | trtime_to_secs (const trtime_t *const lt) |
LT_INLINE void | secs_to_trtime (uint32_t seconds, trtime_t *lt) |
LT_INLINE void | time_sub (const trtime_t *x, const trtime_t *y, trtime_t *res) |
LT_INLINE void | time_add (const trtime_t *x, const trtime_t *y, trtime_t *res) |
LT_INLINE int | time_compare (const trtime_t *t1, const trtime_t *t2) |
LT_INLINE int | time_lessthan (const trtime_t *t1, const trtime_t *t2) |
Time structure.
Different hardware architectures may represent time in formats that are most efficient and suitable for that hardware. We impose no requirements except for two functions that can convert this hardware dependent time structure into units of seconds and vice-versa The trtime_t structure consists of two elements:
Time subtraction.
Note: Time1 >= Time2, check using time_compare if needed.
x | Time1 | |
y | Time2 | |
[out] | res | Time1 - Time 2 |
Time addition.
x | Time1 | |
y | Time2 | |
[out] | res | Time1 + Time 2 |
Time comparison.
t1 | Time1 | |
t2 | Time2 |
Time less than.
t1 | Time1 | |
t2 | Time2 |