mirror of
https://github.com/rehlds/rehlds.git
synced 2025-01-28 22:48:05 +03:00
Make Sys_FloatTime steady in linux, fix #441
This commit is contained in:
parent
4a179e2d8b
commit
827c66f624
@ -625,9 +625,17 @@ double Sys_FloatTime(void)
|
|||||||
if ( !bInitialized )
|
if ( !bInitialized )
|
||||||
{
|
{
|
||||||
bInitialized = true;
|
bInitialized = true;
|
||||||
|
#ifdef REHLDS_FIXES
|
||||||
|
clock_gettime(CLOCK_MONOTONIC_RAW, &start_time);
|
||||||
|
#else
|
||||||
clock_gettime(CLOCK_MONOTONIC, &start_time);
|
clock_gettime(CLOCK_MONOTONIC, &start_time);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
#ifdef REHLDS_FIXES
|
||||||
|
clock_gettime(CLOCK_MONOTONIC_RAW, &now);
|
||||||
|
#else
|
||||||
clock_gettime(CLOCK_MONOTONIC, &now);
|
clock_gettime(CLOCK_MONOTONIC, &now);
|
||||||
|
#endif
|
||||||
return (now.tv_sec - start_time.tv_sec) + now.tv_nsec * 0.000000001;
|
return (now.tv_sec - start_time.tv_sec) + now.tv_nsec * 0.000000001;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user