C-Coder run-time performance

2 次查看(过去 30 天)
Sam
Sam 2023-11-8
回答: atharva 2023-11-9
Hi,
I was wondering if there is any way to evaluate the timing performance of generated C-Code of a Simulink model.
I am aware of the build in function "profile viewer"
However, this gives only a generic solution of specific Matlab-code and depends naturally on my computer performance.
I would like to evaluate for example the excecution time of my generated code for the specified embedded system,
which is in my case the TI C2000 Dual Core (F28379D Launchpad) .
The reason: The matlab function which I compile to my target has quite a good exceution time in "profile viewer" but not on my target.
I evaluated this by placing a counter within the embedded system. The difference to the "profile viewer" is enormous.
I would like to find the pieces of code that are responsible for the long run-time without implementig a counter for each line.
Cheers

回答(1 个)

atharva
atharva 2023-11-9
Hey Sam,
I understand that you are facing an issue where "profile viewer" is showing good exceution time for the generated code but not on your target.
You can use the tic and toc function, tic works with the toc function to measure elapsed time. The tic function records the current time, and the toc function uses the recorded value to calculate the elapsed time.
Also you can try the following methods to optimize your code-
I hope this helps!

类别

Help CenterFile Exchange 中查找有关 Deployment, Integration, and Supported Hardware 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by