summaryrefslogtreecommitdiff
path: root/tests/libgit2/perf/helper__perf__timer.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libgit2/perf/helper__perf__timer.h')
-rw-r--r--tests/libgit2/perf/helper__perf__timer.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/libgit2/perf/helper__perf__timer.h b/tests/libgit2/perf/helper__perf__timer.h
new file mode 100644
index 000000000..5aff4b136
--- /dev/null
+++ b/tests/libgit2/perf/helper__perf__timer.h
@@ -0,0 +1,27 @@
+#if defined(GIT_WIN32)
+
+struct perf__timer
+{
+ LARGE_INTEGER sum;
+ LARGE_INTEGER time_started;
+};
+
+#define PERF_TIMER_INIT {0}
+
+#else
+
+struct perf__timer
+{
+ uint32_t sum;
+ uint32_t time_started;
+};
+
+#define PERF_TIMER_INIT {0}
+
+#endif
+
+typedef struct perf__timer perf_timer;
+
+void perf__timer__start(perf_timer *t);
+void perf__timer__stop(perf_timer *t);
+void perf__timer__report(perf_timer *t, const char *fmt, ...);