From f8952d5caee934cedbc30197379f465a68d30688 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Fri, 31 Jul 2020 13:06:52 +1000 Subject: [PATCH] - directly cast `steady_clock::now()` to nanoseconds instead of microseconds then multiplying by 1000. --- source/common/utility/i_time.cpp | 4 +--- source/common/utility/i_time.h | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/source/common/utility/i_time.cpp b/source/common/utility/i_time.cpp index 9a742dbba..8797ebdee 100644 --- a/source/common/utility/i_time.cpp +++ b/source/common/utility/i_time.cpp @@ -48,12 +48,10 @@ static uint64_t CurrentFrameStartTime; static uint64_t FreezeTime; int GameTicRate = 35; // make sure it is not 0, even if the client doesn't set it. -double TimeScale = 1.0; - static uint64_t GetClockTimeNS() { using namespace std::chrono; - return (uint64_t)((duration_cast(steady_clock::now().time_since_epoch()).count()) * (uint64_t)(TimeScale * 1000)); + return (uint64_t)(duration_cast(steady_clock::now().time_since_epoch()).count()); } static uint64_t MSToNS(unsigned int ms) diff --git a/source/common/utility/i_time.h b/source/common/utility/i_time.h index 58b95c626..b0ff122f4 100644 --- a/source/common/utility/i_time.h +++ b/source/common/utility/i_time.h @@ -3,7 +3,6 @@ #include extern int GameTicRate; -extern double TimeScale; // Called by D_DoomLoop, sets the time for the current frame void I_SetFrameTime();