summaryrefslogtreecommitdiff
path: root/src/timing.h
diff options
context:
space:
mode:
authorPhilip Kelley <phkelley@hotmail.com>2013-09-21 18:25:54 -0400
committerPhilip Kelley <phkelley@hotmail.com>2013-09-21 18:25:54 -0400
commite4987b6ce2db08d87463ef9291151ed6cb4839f2 (patch)
tree183c45773bade3212e67a4be3c823804d2302a93 /src/timing.h
parent37bf1bc129e10fec17e9d1cd9674f659fb01670f (diff)
downloadlibgit2-stopwatch.tar.gz
Improvements to stopwatch implementationstopwatch
Diffstat (limited to 'src/timing.h')
-rw-r--r--src/timing.h9
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;