mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-13 07:58:04 +00:00
- removed unused parts from timer.cpp.
This commit is contained in:
parent
5af71c0af2
commit
70cac1db54
2 changed files with 1 additions and 11 deletions
|
@ -10,9 +10,6 @@
|
||||||
|
|
||||||
int timerInit(int const tickspersecond);
|
int timerInit(int const tickspersecond);
|
||||||
void timerUpdateClock(void);
|
void timerUpdateClock(void);
|
||||||
int timerGetClockRate(void);
|
|
||||||
uint64_t timerGetTicksU64(void);
|
|
||||||
uint64_t timerGetFreqU64(void);
|
|
||||||
double timerGetHiTicks(void);
|
double timerGetHiTicks(void);
|
||||||
uint32_t timerGetTicks(void);
|
uint32_t timerGetTicks(void);
|
||||||
|
|
||||||
|
|
|
@ -14,12 +14,8 @@ EDUKE32_STATIC_ASSERT((steady_clock::period::den/steady_clock::period::num) >= 1
|
||||||
|
|
||||||
static time_point<steady_clock> timerlastsample;
|
static time_point<steady_clock> timerlastsample;
|
||||||
static int timerticspersec;
|
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(); }
|
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.
|
// Returns the time since an unspecified starting time in milliseconds.
|
||||||
// (May be not monotonic for certain configurations.)
|
// (May be not monotonic for certain configurations.)
|
||||||
|
@ -29,9 +25,6 @@ int timerInit(int const tickspersecond)
|
||||||
{
|
{
|
||||||
timerticspersec = tickspersecond;
|
timerticspersec = tickspersecond;
|
||||||
timerlastsample = steady_clock::now();
|
timerlastsample = steady_clock::now();
|
||||||
|
|
||||||
usertimercallback = NULL;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +34,7 @@ void timerUpdateClock(void)
|
||||||
auto elapsedTime = time - timerlastsample;
|
auto elapsedTime = time - timerlastsample;
|
||||||
|
|
||||||
uint64_t numerator = (elapsedTime.count() * (uint64_t) timerticspersec * steady_clock::period::num);
|
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;
|
int n = numerator / freq;
|
||||||
|
|
||||||
if (n <= 0) return;
|
if (n <= 0) return;
|
||||||
|
|
Loading…
Reference in a new issue