Hi community,
I have a question about the calculation of time of one function.
I want to have some explanations because I don't understand very well how to perform the time analysis of the functions of my code. I need to know very well the time of execution of my code in order to comprehend the relationship between the frequency of CAN message.
I downloaded the example of S32K142_02_time_measure_01.7z from the website
"https://community.nxp.com/t5/S32K-Knowledge-Base/Measure-the-running-time-of-one-function-on-S32K/ta..."
I want to know what is the unit of measurements of the variabile ARM_CM_DWT_CYCCNT. I need to calculate the time of the functions of my code. If the difference between two executions is equal to 415 and in my code I choose the SlowRunMode (Bus Clock, Core Clock and Sys Clock equal to 48MHz) I should calculate the ratio between 415/(48MHz) for the fact that the Core Clock is equal to 48MHz?
Thank you for your help
Best regards,
Paola
Solved! Go to Solution.
Hi p_decesare,
Yes. Your calculation is correct.
The unit of measurements of the variabile ARM_CM_DWT_CYCCNT is CORE_CLK cycles.
For example: set a breakpoint at the end of elapsed_time_stop, you will see the CORE_CLK cycles the Code being measured.
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi p_decesare,
Yes. Your calculation is correct.
The unit of measurements of the variabile ARM_CM_DWT_CYCCNT is CORE_CLK cycles.
For example: set a breakpoint at the end of elapsed_time_stop, you will see the CORE_CLK cycles the Code being measured.
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------