Filter löschen
Filter löschen

C-Coder run-time performance

3 Ansichten (letzte 30 Tage)
Sam
Sam am 8 Nov. 2023
Beantwortet: atharva am 9 Nov. 2023
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

Antworten (1)

atharva
atharva am 9 Nov. 2023
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!

Kategorien

Mehr zu Deployment, Integration, and Supported Hardware finden Sie in Help 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