1 #include <Misc/Timer.hpp>
6 #define MICRO_IN_SECONDS 1000000
11 static suseconds_t get_ticks()
14 gettimeofday(&(tmp), NULL);
16 return tmp.tv_usec + (tmp.tv_sec * MICRO_IN_SECONDS);
28 this->startMark = get_ticks();
36 if (!running || paused)
return;
38 this->pausedMark = get_ticks() - (this->startMark);
40 this->running =
false;
45 if (!paused || running)
return;
47 this->startMark = (get_ticks()) - (this->pausedMark);
64 return get_ticks() - this->startMark;
67 return this->pausedMark;
70 if (this->startMark == 0)
73 return (this->pausedMark) - (this->startMark);