tests: Automatically time TAP tests
[lttng-tools.git] / tests / utils / tap / clock.cpp
diff --git a/tests/utils/tap/clock.cpp b/tests/utils/tap/clock.cpp
new file mode 100644 (file)
index 0000000..5a99ddd
--- /dev/null
@@ -0,0 +1,18 @@
+/**
+ * Copyright (C) 2023 Kienan Stewart <kstewart@efficios.com>
+ *
+ * SPDX-License-Identifier: LGPL-2.1-only
+ */
+
+#include "common/time.hpp"
+
+#include <stdio.h>
+
+int main() {
+   struct timespec t;
+   int ret = lttng_clock_gettime(CLOCK_MONOTONIC, &t);
+   if (ret == 0) {
+      printf("%ld.%09ld\n", t.tv_sec, t.tv_nsec);
+   }
+   return ret;
+}
This page took 0.023218 seconds and 4 git commands to generate.