From e33f0269d304f5da518530d50c847627bccf02de Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 18 Dec 2023 09:17:32 +1100 Subject: [PATCH] Tools: improved benchmarking of time functions --- Tools/CPUInfo/CPUInfo.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Tools/CPUInfo/CPUInfo.cpp b/Tools/CPUInfo/CPUInfo.cpp index a20db4924d..4929cc51a7 100644 --- a/Tools/CPUInfo/CPUInfo.cpp +++ b/Tools/CPUInfo/CPUInfo.cpp @@ -15,6 +15,7 @@ #if HAL_WITH_DSP && CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS #include +#include #endif void setup(); @@ -129,6 +130,13 @@ static void show_timings(void) TIMEIT("millis16()", AP_HAL::millis16(), 200); TIMEIT("micros64()", AP_HAL::micros64(), 200); +#if CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS + TIMEIT("hrt_micros32()", hrt_micros32(), 200); + TIMEIT("hrt_micros64()", hrt_micros64(), 200); + TIMEIT("hrt_millis32()", hrt_millis32(), 200); + TIMEIT("hrt_millis64()", hrt_millis64(), 200); +#endif + TIMEIT("fadd", v_out += v_f, 100); TIMEIT("fsub", v_out -= v_f, 100); TIMEIT("fmul", v_out *= v_f, 100);