Re-implementation of Izanami game engine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
849 B

  1. #ifndef IZ_TIMER_H
  2. #define IZ_TIMER_H
  3. //#define IZ_LOG_DATE_FRIENDLY
  4. #define IZ_LOG_DATE_ELAPSED_FRIENDLY
  5. #include <stdio.h>
  6. #include <time.h>
  7. /**
  8. * The start timestamp.
  9. * @sa IZ_TimerStart
  10. */
  11. static time_t IZ_TIMER_START_TIMESTAMP = 0;
  12. /**
  13. * Gets the start timestamp.
  14. * @sa IZ_TIMER_START_TIMESTAMP
  15. */
  16. void IZ_TimerStart();
  17. /**
  18. * Gets the number of microseconds since the application timer has been started.
  19. * @return The number of microseconds.
  20. * @sa IZ_TimerElapsed()
  21. */
  22. unsigned int IZ_TimerElapsedRaw();
  23. /**
  24. * Gets the formatted elapsed time since the application timer has been started.
  25. * @return The formatted elapsed time.
  26. * @sa IZ_TimerElapsedRaw()
  27. */
  28. char* IZ_TimerElapsed();
  29. /**
  30. * Gets the formatted time in the current instant.
  31. * @return The formatted time in the current instant.
  32. */
  33. char* IZ_TimerNow();
  34. #endif