SIP-router core :: timer frequency and ticks conversionsModule: SIP-router core.
More...
Go to the source code of this file.
Defines
-
#define MS_TO_TICKS(m) (((m)*TIMER_TICKS_HZ+999U)/1000U)
- how many ticks per m milliseconds? (rounded up)
-
#define S_TO_TICKS(s) ((s)*TIMER_TICKS_HZ)
- how many ticks per s seconds?
-
#define TICKS_CMP_OP(t1, t2, OP) (((s_ticks_t)((ticks_t)(t1)-(ticks_t)(t2))) OP (s_ticks_t)0)
- ticks comparison operations: t1 OP t2, where OP can be <, >, <=, >=
-
#define TICKS_GE(t1, t2) TICKS_CMP_OP(t1, t2, >=)
- t1 >= t2
-
#define TICKS_GT(t1, t2) TICKS_CMP_OP(t1, t2, >)
- t1 > t2
-
#define TICKS_LE(t1, t2) TICKS_CMP_OP(t1, t2, <=)
- t1 <= t2
-
#define TICKS_LT(t1, t2) TICKS_CMP_OP(t1, t2, <)
- t1 < t2
-
#define TICKS_TO_MS(t) (((t)*1000U)/TIMER_TICKS_HZ)
- how many ms per t ticks, integer value
-
#define TICKS_TO_S(t) ((t)/TIMER_TICKS_HZ)
- how many s pe per t ticks, integer value
-
#define TIMER_TICKS_HZ 16U
- how many ticks per second (must >1 and < 100 (on linux x86)) recomended values >=8, <=32 (a 2^k value is better/faster)
Detailed Description
Definition in file timer_ticks.h.