Use CLOCK_MONOTONIC_RAW for timers if available
Should make timers work more precisely on Linux.
This commit is contained in:
parent
952cf985dc
commit
c1c191717f
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user