what is the most accurate way in FreeRTOS to convert tick counts to milliseconds?

hey guys, I'm working on an embedded system running FreeRTOS on an ARM Cortex-M4 microcontroller clocked at 72MHz. I need to measure the execution time of a specific code block to optimize performance. The code snippet using
xTaskGetTickCount
xTaskGetTickCount
provides tick counts, but I need the time in milliseconds for better analysis. Considering the clock speed, what is the most accurate way in FreeRTOS to convert tick counts to milliseconds and achieve millisecond-level resolution for measuring code execution time? @Middleware & OS
3 Replies
ZacckOsiemo
ZacckOsiemo2w ago
so you have 72M ticks per a second. Ok your task takes from tickX to tickY. So taskTicks is tickY - tickX. from there is just some sums to ms?
Dtynin
Dtynin2w ago
Ok thanks, but are there any conversion model, after carrying out this action to convert to milliseconds?
ZacckOsiemo
ZacckOsiemo2w ago
No just math its basic 1000ms = 72M ticks, ?ms = taskTicks