Hi,
There is a thread that talks about a different platform but provides some ideas of the execution time:
Solved: How can I measure the execution time of a function... - NXP Community
Another idea is what it was already provided, which is using a timer to measure the entry and exit of the function, it just needs to be set so that it stops when the debugging session is halted by a breakpoint.
Another possibility is provided under the thread, which is measuring by executed instructions under the function.
There is also an explanation provided under the following AN:
Measuring Interrupt Latency (nxp.com)
Which could be of use.
Please, let us know.