From 1dc3bc5db3b3ba60399bee4753abe2f78374a2dd Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Tue, 17 Dec 2024 16:10:30 -0500 Subject: pktmr: first-pass, all macros, no IMPL --- test/pktmr.c | 24 ++++++++++++++++++++++++ test/pktmr.cpp | 24 ++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 test/pktmr.c create mode 100644 test/pktmr.cpp (limited to 'test') 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 +#include + +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 +#include + +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; +} -- cgit v1.2.3