diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-08-30 18:56:49 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-08-30 18:56:49 +0300 |
| commit | 1a2e1fff7ce4b8fd8db46549d81e71e76b842da3 (patch) | |
| tree | e33fa259bf9de49e589dd1e75a95dcd09ad3bc97 /benchmarks/create/init.c | |
| parent | ec30538a81c0e900797f4d88c1ee059afa7d9617 (diff) | |
| download | kmi-1a2e1fff7ce4b8fd8db46549d81e71e76b842da3.tar.gz kmi-1a2e1fff7ce4b8fd8db46549d81e71e76b842da3.zip | |
add some basic benchmarks
Diffstat (limited to 'benchmarks/create/init.c')
| -rw-r--r-- | benchmarks/create/init.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/benchmarks/create/init.c b/benchmarks/create/init.c new file mode 100644 index 0000000..7254296 --- /dev/null +++ b/benchmarks/create/init.c @@ -0,0 +1,27 @@ +#include <common/benchmark.h> + +void callback() +{ + sys_exit(1); +} + +START(pid, tid, d0, d1, d2, d3) +{ + UNUSED(pid); + UNUSED(tid); + UNUSED(d0); + UNUSED(d1); + UNUSED(d2); + UNUSED(d3); + + uint64_t timebase = sys_timebase(); + uint64_t start = sys_ticks(); + + for (size_t i = 0; i < 1000; ++i) { + id_t new_id = sys_create((uintptr_t)callback, 0, 0, 0, 0); + sys_swap(new_id); + } + + uint64_t end = sys_ticks(); + report(start, end, timebase); +} |
