Use CLOCK_MONOTONIC_RAW for timers if available

Should make timers work more precisely on Linux.
This commit is contained in:
Přemysl Eric Janouch 2016-10-04 15:38:16 +02:00
parent 952cf985dc
commit c1c191717f
Signed by: p
GPG Key ID: B715679E3A361BE6

View File

@ -83,7 +83,10 @@
extern char **environ; extern char **environ;
#ifdef _POSIX_MONOTONIC_CLOCK #ifdef CLOCK_MONOTONIC_RAW
// This should be more accurate for shorter intervals
#define CLOCK_BEST CLOCK_MONOTONIC_RAW
#elif defined _POSIX_MONOTONIC_CLOCK
#define CLOCK_BEST CLOCK_MONOTONIC #define CLOCK_BEST CLOCK_MONOTONIC
#else // ! _POSIX_MONOTIC_CLOCK #else // ! _POSIX_MONOTIC_CLOCK
#define CLOCK_BEST CLOCK_REALTIME #define CLOCK_BEST CLOCK_REALTIME