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
I can start a measurement point, and with
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,
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.