I am using code execution profiling and I choose different settings for 'Measure function execution times': coarse vs detailed and two different settings for save options: 'summary' vs 'all'
These settings seem to affect the code execution time for the ISR routine drastically:
34us (detailed / all), 28us (detailed / summary), 15us (coarse / summary).
Is this an expected behavior? Can the effect of these settings on execution time be minimized.

 Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 15 Feb. 2022

0 Stimmen

This is an expected behavior as the 'detailed' option for 'measure function execution times' parameter introduces excess instrumentation overhead for execution time measurements.
This is also shown as a warning in the diagnostic viewer when one tries to build the model with this option enabled.
Setting the parameter to 'detailed' reports the profiling data for all the function calls inside the task. Instead, set it to 'off' or 'coarse' to get the profiling data for a specific task or an ISR. This data also contains the execution time of all the function calls inside the ISR but does not specifically measure the execution time for each of the function calls.
All these above discussed settings will add a small amount of overhead that cannot be avoided. If it is intended to measure the exact code execution time, consider to toggle a GPIO pin at the start and end of the function and measure the execution time.

Weitere Antworten (0)

Kategorien

Mehr zu Deployment, Integration, and Supported Hardware finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by