How to calculate execution time in Matlab?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
#Help_Please
Hello, hope that you're in a good health
I have 2 heuristics and i want to calculate the execution time for each instance, what's the right instruction to do it?
0 Kommentare
Akzeptierte Antwort
Jan
am 30 Jul. 2022
The direct method:
tic
x = sin(rand(1e4, 1e4));
toc
The smart method:
timeit(@() sin(rand(1e4, 1e4)))
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!