Open Source Tomb Raider 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.

time.cpp 442B

12345678910111213141516171819202122232425
  1. /*!
  2. * \file include/utils/time.h
  3. * \brief Time handling utilities
  4. *
  5. * \author xythobuz
  6. */
  7. #include <ctime>
  8. #include "utils/time.h"
  9. #define CLOCKS_PER_MS (CLOCKS_PER_SEC / 1000)
  10. clock_t system_timer_start;
  11. clock_t system_timer_stop;
  12. unsigned int systemTimerGet() {
  13. system_timer_stop = clock();
  14. return (system_timer_stop - system_timer_start) / CLOCKS_PER_MS;
  15. }
  16. void systemTimerReset() {
  17. system_timer_start = clock();
  18. }