From 0698bcc899323c383f177413ee610242fffce4d0 Mon Sep 17 00:00:00 2001 From: In-line Date: Sat, 29 Apr 2017 11:14:13 +0400 Subject: [PATCH] Refactor Sys_FloatTime in linux --- rehlds/engine/sys_dll.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rehlds/engine/sys_dll.cpp b/rehlds/engine/sys_dll.cpp index 5d4fc01..1e3c38a 100644 --- a/rehlds/engine/sys_dll.cpp +++ b/rehlds/engine/sys_dll.cpp @@ -619,15 +619,15 @@ double EXT_FUNC Sys_FloatTime(void) double Sys_FloatTime(void) { static struct timespec start_time; - static bool bInitialized; + static bool bInitialized = false; struct timespec now; if ( !bInitialized ) { - bInitialized = 1; - clock_gettime(1, &start_time); + bInitialized = true; + clock_gettime(CLOCK_MONOTONIC, &start_time); } - clock_gettime(1, &now); + clock_gettime(CLOCK_MONOTONIC, &now); return (now.tv_sec - start_time.tv_sec) + now.tv_nsec * 0.000000001; }