Can the Code Profiler be used programmatically to profile an app in App Designer?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Michael Van de Graaff
le 23 Mai 2022
Réponse apportée : Voss
le 28 Mai 2022
I am aware that I can open the Profiler, click 'start profiling' run my app, then stop profilling and view it.
Can I initiate the start and stop of the profiling programatically?
tic/toc is good, but that's better to test implementations. the Profiler is great to look at overall where my code is slow.
0 commentaires
Réponse acceptée
Voss
le 28 Mai 2022
"Can I initiate the start and stop of the profiling programatically?"
Yes. See the "action" input argument part of the documentation for profile:
Using some of those actions, maybe you can do what you want:
% turn on and start the profiler:
profile('on');
profile('resume');
% run a function:
test_func();
% get the current profiler info:
s = profile('info')
s.FunctionTable
% get the info about the function test_func:
s.FunctionTable(strcmp({s.FunctionTable.FunctionName},'test_func'))
% stop the profiler:
profile('off');
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Develop Apps Using App Designer dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!