18 #ifndef _RTEMS_SCORE_TIMESPEC_H 19 #define _RTEMS_SCORE_TIMESPEC_H 52 #define _Timespec_Set( _time, _seconds, _nanoseconds ) \ 54 (_time)->tv_sec = (_seconds); \ 55 (_time)->tv_nsec = (_nanoseconds); \ 66 #define _Timespec_Set_to_zero( _time ) \ 68 (_time)->tv_sec = 0; \ 69 (_time)->tv_nsec = 0; \ 81 #define _Timespec_Get_seconds( _time ) \ 93 #define _Timespec_Get_nanoseconds( _time ) \ 106 const struct timespec *time
120 const struct timespec *time
135 const struct timespec *lhs,
136 const struct timespec *rhs
150 #define _Timespec_Greater_than( _lhs, _rhs ) \ 151 _Timespec_Less_than( _rhs, _lhs ) 164 #define _Timespec_Equal_to( lhs, rhs ) \ 165 ( ((lhs)->tv_sec == (rhs)->tv_sec) && \ 166 ((lhs)->tv_nsec == (rhs)->tv_nsec) \ 181 struct timespec *time,
182 const struct timespec *add
196 const struct timespec *time
210 struct timespec *time
224 const struct timespec *start,
225 const struct timespec *end,
226 struct timespec *result
241 const struct timespec *time,
243 struct timespec *result
258 const struct timespec *lhs,
259 const struct timespec *rhs,
260 uint32_t *ival_percentage,
261 uint32_t *fval_percentage
uint32_t _Timespec_To_ticks(const struct timespec *time)
Converts timespec to number of ticks.
bool _Timespec_Is_valid(const struct timespec *time)
Checks if timespec is valid.
void _Timespec_Divide_by_integer(const struct timespec *time, uint32_t iterations, struct timespec *result)
Divides timespec by an integer.
void _Timespec_Subtract(const struct timespec *start, const struct timespec *end, struct timespec *result)
Subtracts two timespec.
void _Timespec_Divide(const struct timespec *lhs, const struct timespec *rhs, uint32_t *ival_percentage, uint32_t *fval_percentage)
Divides a timespec by another timespec.
bool _Timespec_Less_than(const struct timespec *lhs, const struct timespec *rhs)
Checks if the left hand side timespec is less than the right one.
void _Timespec_From_ticks(uint32_t ticks, struct timespec *time)
Converts ticks to timespec.
uint64_t _Timespec_Get_as_nanoseconds(const struct timespec *time)
Gets the timestamp as nanoseconds.
uint32_t _Timespec_Add_to(struct timespec *time, const struct timespec *add)
Adds two timespecs.