C Algorithm, Execution Time

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

C Algorithm, Execution Time

744 Views
walter_gallegos
Contributor I

I'm working with a sliced algorithm, so I like to know the execution time of each slice.

Exist into KDS a tool to calculate the execution time of a C algorithm or process ?

Labels (1)
0 Kudos
2 Replies

397 Views
BlackNight
NXP Employee
NXP Employee

Hi Walter,

I'm using the Segger SystemViewer (see https://mcuoneclipse.com/2015/11/16/segger-systemview-realtime-analysis-and-visualization-for-freert... ) for this kind of measurement. With

SEGGER_SYSVIEW_OnUserStart(id)

I can start a measurement point, and with

SEGGER_SYSVIEW_OnUserStop(id)

I have the corresponding end point. You can have multiple different IDs so you can measure different spans. Using the SystemViewer I get the exact timing. I hope you are using a Cortex-M4(F) core, then you get the number of cycles. Otherwise on an a M0+ (because it does not have a cycle counter in hardware) the timing is measured with the SysTick ticks.

I hope this helps,

Erich

0 Kudos

397 Views
walter_gallegos
Contributor I

Hi Erich

Thank for answer, Segger SystemViewer apparently do the task; unfortunately I'm using  a P&E pod. So, I don't have access to a J-Link.

I will place some assert to validate pre/post-conditions into the slices; is not the same but be warrant non overlapping working condition.

Regards

Walter

0 Kudos