summaryrefslogtreecommitdiff
path: root/test/pktmr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/pktmr.cpp')
-rw-r--r--test/pktmr.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/pktmr.cpp b/test/pktmr.cpp
new file mode 100644
index 0000000..1a5894f
--- /dev/null
+++ b/test/pktmr.cpp
@@ -0,0 +1,24 @@
+
+#include "../pktmr.h"
+#include "../pkmacros.h"
+
+#include <stdint.h>
+#include <stdio.h>
+
+int main(int argc, char *argv[])
+{
+ struct pk_tmr tmr = {};
+ uint64_t asdf;
+ (void)asdf;
+ (void)stdout;
+
+ // timer
+ {
+ pk_tmr_start(tmr);
+ pk_tmr_stop(tmr);
+ PK_LOGV_INF("%s: elapsed time (nano): %li\n", __FILE__, pk_tmr_duration_nano(tmr));
+ PK_LOGV_INF("%s: elapsed time (double): %.9f\n", __FILE__, pk_tmr_duration_double(tmr));
+ }
+
+ return 0;
+}