blob: 7a62a00db41ec4913322550a70a1b6478a06579f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#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;
(void)argc;
(void)argv;
// timer
{
pk_tmr_start(tmr);
pk_tmr_stop(tmr);
PK_LOGV_INF("%s: elapsed time (u64) ns: %llu\n", __FILE__, pk_tmr_duration_u64_nano(tmr));
PK_LOGV_INF("%s: elapsed time (dbl) ns: %.9f\n", __FILE__, pk_tmr_duration_dbl_nano(tmr));
PK_LOGV_INF("%s: elapsed time (dbl) μs: %.9f\n", __FILE__, pk_tmr_duration_dbl_micro(tmr));
PK_LOGV_INF("%s: elapsed time (dbl) ms: %.9f\n", __FILE__, pk_tmr_duration_dbl_mili(tmr));
PK_LOGV_INF("%s: elapsed time (dbl) s: %.9f\n", __FILE__, pk_tmr_duration_dbl_scnd(tmr));
}
return 0;
}
|