# Help with the library elapsed_time for the time analysis of function

cancel
Showing results for
Show  only  | Search instead for
Did you mean:
SOLVED

## Help with the library elapsed_time for the time analysis of function

1,029 Views
Contributor III

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.

"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?

Best regards,

Paola

1 Solution
1,023 Views
NXP TechSupport

Hi p_decesare,

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

-----------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------------

1,024 Views
NXP TechSupport

Hi p_decesare,

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

-----------------------------------------------------------------------------------------------------------------------