From 827c66f624d7216fad9875818adfec9f9fe10c3b Mon Sep 17 00:00:00 2001 From: In-line Date: Thu, 27 Apr 2017 16:34:35 +0400 Subject: [PATCH] Make Sys_FloatTime steady in linux, fix #441 --- rehlds/engine/sys_dll.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rehlds/engine/sys_dll.cpp b/rehlds/engine/sys_dll.cpp index 1e3c38a..fbc474b 100644 --- a/rehlds/engine/sys_dll.cpp +++ b/rehlds/engine/sys_dll.cpp @@ -625,9 +625,17 @@ double Sys_FloatTime(void) if ( !bInitialized ) { bInitialized = true; +#ifdef REHLDS_FIXES + clock_gettime(CLOCK_MONOTONIC_RAW, &start_time); +#else clock_gettime(CLOCK_MONOTONIC, &start_time); +#endif } +#ifdef REHLDS_FIXES + clock_gettime(CLOCK_MONOTONIC_RAW, &now); +#else clock_gettime(CLOCK_MONOTONIC, &now); +#endif return (now.tv_sec - start_time.tv_sec) + now.tv_nsec * 0.000000001; }