From 7bc8d2baffa56b29c4ca3963a923083933b8261c Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 20 Jun 2020 11:55:30 +0200 Subject: [PATCH] - I_msTimeF. --- source/common/utility/i_time.cpp | 5 +++++ source/common/utility/i_time.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/source/common/utility/i_time.cpp b/source/common/utility/i_time.cpp index a4177e191..5f4e23802 100644 --- a/source/common/utility/i_time.cpp +++ b/source/common/utility/i_time.cpp @@ -142,6 +142,11 @@ uint64_t I_msTime() return NSToMS(I_nsTime()); } +double I_msTimeF(void) +{ + return I_nsTime() / 1'000'000.; +} + uint64_t I_msTimeFS() // from "start" { return (FirstFrameStartTime == 0) ? 0 : NSToMS(I_nsTime() - FirstFrameStartTime); diff --git a/source/common/utility/i_time.h b/source/common/utility/i_time.h index 47d726de7..58b95c626 100644 --- a/source/common/utility/i_time.h +++ b/source/common/utility/i_time.h @@ -25,6 +25,9 @@ void I_FreezeTime(bool frozen); // [RH] Returns millisecond-accurate time uint64_t I_msTime(); +// [RH] Returns nanosecond-accurate time in milliseconds +double I_msTimeF(void); + // [SP] Returns millisecond-accurate time from start uint64_t I_msTimeFS();