Added timer functions.

FossilOrigin-Name: 6fb04df53dbfcfd75428c9c5fd957416841002d89ff4d98bd80df867ae75dd99
This commit is contained in:
7u83@mail.ru 2014-08-16 07:07:56 +00:00
parent 6860d4e6ee
commit 89a68334ff

View File

@ -17,6 +17,7 @@
*/ */
#include <stdint.h> #include <stdint.h>
#include <time.h>
extern uint8_t * cw_setstr(uint8_t ** dst, const uint8_t *src, int len); extern uint8_t * cw_setstr(uint8_t ** dst, const uint8_t *src, int len);
@ -29,3 +30,7 @@ extern int cw_pseudo_rand(uint8_t *dst, int len);
extern int cw_rand(uint8_t*dst, int len); extern int cw_rand(uint8_t*dst, int len);
extern int cw_is_printable(const uint8_t * s,int len); extern int cw_is_printable(const uint8_t * s,int len);
#define cw_timer_start(t) (time(NULL)+t)
#define cw_timer_timeout(t) (time(NULL)>t ? 1 : 0)