diff --git a/sys/Makefile.dep b/sys/Makefile.dep index a5a10a8e27..4925d8daaa 100644 --- a/sys/Makefile.dep +++ b/sys/Makefile.dep @@ -570,7 +570,7 @@ ifneq (,$(filter nanocoap_%,$(USEMODULE))) endif ifneq (,$(filter benchmark,$(USEMODULE))) - USEMODULE += xtimer + USEMODULE += ztimer_usec endif ifneq (,$(filter skald_%,$(USEMODULE))) diff --git a/sys/benchmark/Kconfig b/sys/benchmark/Kconfig index 375ea98406..706fb7f652 100644 --- a/sys/benchmark/Kconfig +++ b/sys/benchmark/Kconfig @@ -7,5 +7,5 @@ config MODULE_BENCHMARK bool "Simple benchmarks support" - depends on MODULE_XTIMER + depends on MODULE_ZTIMER_USEC depends on TEST_KCONFIG diff --git a/sys/benchmark/benchmark.c b/sys/benchmark/benchmark.c index edc8740d0b..3729ea6fe9 100644 --- a/sys/benchmark/benchmark.c +++ b/sys/benchmark/benchmark.c @@ -19,6 +19,7 @@ */ #include +#include "timex.h" #include "benchmark.h" @@ -27,7 +28,7 @@ void benchmark_print_time(uint32_t time, unsigned long runs, const char *name) uint32_t full = (time / runs); uint32_t div = (time - (full * runs)) / (runs / 1000); - uint32_t per_sec = (uint32_t)(((uint64_t)1000000UL * runs) / time); + uint32_t per_sec = (uint32_t)(((uint64_t)US_PER_SEC * runs) / time); printf("%25s: %9" PRIu32 "us" " --- %2" PRIu32 ".%03" PRIu32 "us per call" diff --git a/sys/include/benchmark.h b/sys/include/benchmark.h index 521b5f1d1d..ed8ac218be 100644 --- a/sys/include/benchmark.h +++ b/sys/include/benchmark.h @@ -24,7 +24,7 @@ #include #include "irq.h" -#include "xtimer.h" +#include "ztimer.h" #ifdef __cplusplus extern "C" { @@ -43,11 +43,11 @@ extern "C" { */ #define BENCHMARK_FUNC(name, runs, func) \ { \ - uint32_t _benchmark_time = xtimer_now_usec(); \ + uint32_t _benchmark_time = ztimer_now(ZTIMER_USEC); \ for (unsigned long i = 0; i < runs; i++) { \ func; \ } \ - _benchmark_time = (xtimer_now_usec() - _benchmark_time);\ + _benchmark_time = (ztimer_now(ZTIMER_USEC) - _benchmark_time);\ benchmark_print_time(_benchmark_time, runs, name); \ } diff --git a/tests/bench_sys_atomic_utils/Makefile.ci b/tests/bench_sys_atomic_utils/Makefile.ci index 0ddf9b83e4..fa21afb84b 100644 --- a/tests/bench_sys_atomic_utils/Makefile.ci +++ b/tests/bench_sys_atomic_utils/Makefile.ci @@ -2,6 +2,9 @@ BOARD_INSUFFICIENT_MEMORY := \ arduino-duemilanove \ arduino-leonardo \ arduino-nano \ + arduino-uno \ + atmega328p-xplained-mini \ + atmega328p \ nucleo-l011k4 \ samd10-xmini \ stm32f030f4-demo \