diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2016-10-04 15:38:16 +0200 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2016-10-04 15:46:20 +0200 |
commit | c1c191717f5ef2a32ab668c4f82dbe4d89616314 (patch) | |
tree | aa28002259d8e9a6f2882146c87b5a66f33a0ddc | |
parent | 952cf985dca6a97ee662f3b189788089abd2ef57 (diff) | |
download | liberty-c1c191717f5ef2a32ab668c4f82dbe4d89616314.tar.gz liberty-c1c191717f5ef2a32ab668c4f82dbe4d89616314.tar.xz liberty-c1c191717f5ef2a32ab668c4f82dbe4d89616314.zip |
Use CLOCK_MONOTONIC_RAW for timers if available
Should make timers work more precisely on Linux.
-rw-r--r-- | liberty.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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 |