diff options
Diffstat (limited to 'src/timing.h')
-rw-r--r-- | src/timing.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/timing.h b/src/timing.h index 6ee631a01..3dc18f467 100644 --- a/src/timing.h +++ b/src/timing.h @@ -35,8 +35,17 @@ typedef struct git_stopwatch { #else +/* On systems which support CLOCK_MONOTONIC, prefer it + * over CLOCK_REALTIME */ +#ifdef CLOCK_MONOTONIC +# define GIT_PREFERRED_CLOCK CLOCK_MONOTONIC +#else +# define GIT_PREFERRED_CLOCK CLOCK_REALTIME +#endif + typedef struct git_stopwatch { struct timespec start; + clockid_t clk_id; unsigned running : 1; } git_stopwatch; |