Skip to content

Commit

Permalink
Remove redundant RageTimer constant defines
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Dec 2, 2019
1 parent 4cf772e commit 27469ad
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/RageUtil/Misc/RageTimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@

#include <chrono>

// this is hereby the difference between a second and a microsecond
#define INT_TIMESTAMP_RESOLUTION 1000000
#define FLOAT_TIMESTAMP_RESOLUTION 1000000.f
// let this henceforth be referred to as the difference between a second and a
// microsecond *kingly fanfare*
#define TIMESTAMP_RESOLUTION 1000000

const RageTimer RageZeroTimer(0);
static std::chrono::microseconds g_iStartTime =
Expand All @@ -54,7 +54,7 @@ RageTimer::GetTimeSinceStart()
auto usecs = GetChronoTime();
std::chrono::microseconds g = usecs - g_iStartTime;

return g.count() / FLOAT_TIMESTAMP_RESOLUTION;
return g.count() / TIMESTAMP_RESOLUTION;
}

uint64_t
Expand Down Expand Up @@ -124,7 +124,7 @@ RageTimer::operator<(const RageTimer& rhs) const
RageTimer
RageTimer::Sum(const RageTimer& lhs, float tm)
{
uint64_t usecs = static_cast<uint64_t>(tm * INT_TIMESTAMP_RESOLUTION);
uint64_t usecs = static_cast<uint64_t>(tm * TIMESTAMP_RESOLUTION);
std::chrono::microseconds period(usecs);

RageTimer ret(0); // Prevent unnecessarily checking the time
Expand All @@ -138,7 +138,7 @@ RageTimer::Difference(const RageTimer& lhs, const RageTimer& rhs)
{
std::chrono::microseconds diff = lhs.c_dur - rhs.c_dur;

return static_cast<float>(diff.count()) / FLOAT_TIMESTAMP_RESOLUTION;
return static_cast<float>(diff.count()) / TIMESTAMP_RESOLUTION;
}

#include "Etterna/Singletons/LuaManager.h"
Expand Down

0 comments on commit 27469ad

Please sign in to comment.