utils.h 530 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef __UTILS_H__
  2. #define __UTILS_H__
  3. #include <stdio.h>
  4. #include <unistd.h>
  5. #include <sys/time.h>
  6. #define REAL_TIME 0
  7. #define STANDARD 1
  8. /**
  9. * Calculate a duration
  10. *
  11. * @param start start of the computing or null if
  12. * this is the first time this function is inoked
  13. *
  14. * @return current time
  15. */
  16. struct timeval* showTime(struct timeval* start);
  17. /**
  18. * Switch to real-time mode
  19. *
  20. * @param mode (REAL_TIME | STANDARD)
  21. */
  22. void cpuMode(int mode);
  23. /**
  24. * Exit from real-time mode
  25. */
  26. void scheduler_standard();
  27. #endif