software_timer.h 409 B

12345678910111213141516
  1. #ifndef __SOFTWARE_TIMER_H__
  2. #define __SOFTWARE_TIMER_H__
  3. typedef struct
  4. {
  5. int second; //秒
  6. int usec; //微秒
  7. } sw_timer_t;
  8. extern unsigned long dwTickCount;
  9. void sw_timer_init(int clk);
  10. void sw_timer_now(sw_timer_t *timer);
  11. void sw_timer_start(sw_timer_t *timer,int sec,int usec);
  12. int sw_timer_expire(sw_timer_t *timer);
  13. void sw_timer_delay(sw_timer_t *timer,int sec, int usec);
  14. #endif