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
1 changed files with 4 additions and 1 deletions

View File

@ -83,7 +83,10 @@
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
#else // ! _POSIX_MONOTIC_CLOCK
#define CLOCK_BEST CLOCK_REALTIME