14 #include "coap_config.h" 19 #if _POSIX_TIMERS && !defined(__APPLE__) 23 #define COAP_CLOCK CLOCK_REALTIME 30 clock_gettime(COAP_CLOCK, &tv);
33 gettimeofday(&tv, NULL);
40 #define Q(frac,fval) ((coap_tick_t)(((1 << (frac)) * (fval)))) 46 #define SHR_FP(val,frac) (((val) + (1 << ((frac) - 1))) >> (frac)) 54 clock_gettime(COAP_CLOCK, &tv);
66 gettimeofday(&tv, NULL);
93 static inline void dummy()
void coap_clock_init(void)
Initializes the internal clock.
coap_time_t coap_ticks_to_rt(coap_tick_t t)
Helper function that converts coap ticks to wallclock time.
unsigned long coap_tick_t
This data type represents internal timer ticks with COAP_TICKS_PER_SECOND resolution.
#define COAP_TICKS_PER_SECOND
Use ms resolution on POSIX systems.
time_t coap_time_t
CoAP time in seconds since epoch.
void coap_ticks(coap_tick_t *t)
Sets t to the internal time with COAP_TICKS_PER_SECOND resolution.
static coap_time_t coap_clock_offset
#define SHR_FP(val, frac)