summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/pktmr.c24
-rw-r--r--test/pktmr.cpp24
2 files changed, 48 insertions, 0 deletions
diff --git a/test/pktmr.c b/test/pktmr.c
new file mode 100644
index 0000000..5237415
--- /dev/null
+++ b/test/pktmr.c
@@ -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 = {0};
+ 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;
+}
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;
+}