- prevent nanosecond timer from ever casting into a double

This commit is contained in:
Rachael Alexanderson 2017-11-29 07:43:17 -05:00
parent 8cad912db1
commit 12a44f5bc9

View file

@ -74,7 +74,7 @@ CUSTOM_CVAR(Float, i_timescale, 1.0f, CVAR_NOINITCALL)
static uint64_t GetClockTimeNS()
{
using namespace std::chrono;
return (uint64_t)((duration_cast<nanoseconds>(steady_clock::now().time_since_epoch()).count()) * TimeScale);
return (uint64_t)((duration_cast<microseconds>(steady_clock::now().time_since_epoch()).count()) * (uint64_t)(TimeScale * 1000));
}
static uint64_t MSToNS(unsigned int ms)