MATLAB: How to get the code execution tome of the model in simulink? (for the code generation of the C2000 processors)

c2000execution-time

I want to know what is the execution time of my model in simulink. I need to set a proper sampling time for the code generation for C2000 processors.
Thanks.

Best Answer

Hi JIANWEI,
Here are 2 techniques that will help you profile the execution time of the generated code on the TI C2000 processors:
  1. In R2017a, we introduced multitasking profiling, which will allow you to measure and visualize execution time and preemptions for the different synchronous rates in your model. Check the Real-Time Code Execution Profiling Example to learn more about this technique.
  2. In PIL mode, you can enable profiling and measure the execution time of your generated code. The Code Verification and Validation with PIL Example will show you how to run in PIL on the TI C2000 devices, while the "Code Verification and Validation with PIL" chapter of the documentation will explain you how to enable profiling with PIL.
I hope this helps,
Good luck!
Antonin.
Related Question