- removed unused parts from timer.cpp.

This commit is contained in:
Christoph Oelckers 2020-08-25 21:47:03 +02:00
parent 5af71c0af2
commit 70cac1db54
2 changed files with 1 additions and 11 deletions

View file

@ -10,9 +10,6 @@
int timerInit(int const tickspersecond);
void timerUpdateClock(void);
int timerGetClockRate(void);
uint64_t timerGetTicksU64(void);
uint64_t timerGetFreqU64(void);
double timerGetHiTicks(void);
uint32_t timerGetTicks(void);

View file

@ -14,12 +14,8 @@ EDUKE32_STATIC_ASSERT((steady_clock::period::den/steady_clock::period::num) >= 1
static time_point<steady_clock> timerlastsample;
static int timerticspersec;
static void(*usertimercallback)(void) = NULL;
int timerGetClockRate(void) { return timerticspersec; }
uint32_t timerGetTicks(void) { return duration_cast<milliseconds>(steady_clock::now().time_since_epoch()).count(); }
uint64_t timerGetTicksU64(void) { return steady_clock::now().time_since_epoch().count() * steady_clock::period::num; }
uint64_t timerGetFreqU64(void) { return steady_clock::period::den; }
// Returns the time since an unspecified starting time in milliseconds.
// (May be not monotonic for certain configurations.)
@ -29,9 +25,6 @@ int timerInit(int const tickspersecond)
{
timerticspersec = tickspersecond;
timerlastsample = steady_clock::now();
usertimercallback = NULL;
return 0;
}
@ -41,7 +34,7 @@ void timerUpdateClock(void)
auto elapsedTime = time - timerlastsample;
uint64_t numerator = (elapsedTime.count() * (uint64_t) timerticspersec * steady_clock::period::num);
uint64_t freq = timerGetFreqU64();
uint64_t freq = steady_clock::period::den;
int n = numerator / freq;
if (n <= 0) return;