timer.h 371 B

123456789101112131415161718192021222324252627
  1. #ifndef TIMER_H
  2. #define TIMER_H
  3. #include <stdint.h>
  4. #ifdef __linux__
  5. #include <time.h>
  6. #endif
  7. typedef struct
  8. {
  9. uint8_t day;
  10. uint8_t month;
  11. uint16_t year;
  12. uint32_t sec;
  13. uint32_t usec;
  14. } date_t;
  15. void timer_init();
  16. uint64_t get_time_us();
  17. void set_delta();
  18. uint64_t get_delta();
  19. void micro_sleep(unsigned long x);
  20. unsigned long time_micros();
  21. #endif