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
Solution:
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?
Jump to solution
3 Replies
Solution
ZacckOsiemo
ZacckOsiemo6mo 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
Dtynin6mo ago
Ok thanks, but are there any conversion model, after carrying out this action to convert to milliseconds?
ZacckOsiemo
ZacckOsiemo6mo ago
No just math its basic 1000ms = 72M ticks, ?ms = taskTicks
Want results from more Discord servers?
Add your server