From 1a2e1fff7ce4b8fd8db46549d81e71e76b842da3 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Fri, 30 Aug 2024 18:56:49 +0300 Subject: add some basic benchmarks --- tests/common/benchmark.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/common/benchmark.h (limited to 'tests/common/benchmark.h') diff --git a/tests/common/benchmark.h b/tests/common/benchmark.h new file mode 100644 index 0000000..d3ed6eb --- /dev/null +++ b/tests/common/benchmark.h @@ -0,0 +1,17 @@ +#ifndef KMI_BENCHMARK_H +#define KMI_BENCHMARK_H + +#include "sys.h" +#include "start.h" +#include "printf.h" + +#define exit() sys_poweroff(SYS_SHUTDOWN) +#define report(start, end, timebase)\ + do {\ + printf("%lld / %lld\n", \ + (long long unsigned)((end) - (start)), \ + (long long unsigned)(timebase)); \ + exit();\ + } while (0) + +#endif /* KMI_BENCHMARK_H */ -- cgit v1.3