diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2024-12-17 16:10:30 -0500 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2024-12-17 16:15:05 -0500 |
| commit | 1dc3bc5db3b3ba60399bee4753abe2f78374a2dd (patch) | |
| tree | eaad96f0a30010c00294a687658f6f6e421f0e03 /test | |
| parent | 33484cccdea2790721fb20f75588d1ed4fb53017 (diff) | |
pktmr: first-pass, all macros, no IMPL
Diffstat (limited to 'test')
| -rw-r--r-- | test/pktmr.c | 24 | ||||
| -rw-r--r-- | test/pktmr.cpp | 24 |
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; +} |
