How to compute execution time?
Mostrar comentarios más antiguos
I am executing a MatLab program. I used tic-toc to compute execution time. BUT each time I got a different time? Why?
Respuestas (2)
Muthu Annamalai
el 28 de Jul. de 2015
Have you tried,
- >>doc timeit
- >>doc profile
Using timeit is easy but your script has to be in a function form. Using profile can be done as,
profile on
%your code
profile off
profile info
1 comentario
Nisreen Sulayman
el 28 de Jul. de 2015
Editada: Nisreen Sulayman
el 28 de Jul. de 2015
Image Analyst
el 29 de Jul. de 2015
0 votos
Why shouldn't it? You computer is a multitasking machine. Sometimes it puts your program on hold to take care of other tasks. The number of other tasks that are going on at any given time can vary both in number and priority so the amount of time it has to pause your program varies. Hence the different times.
Categorías
Más información sobre Image Processing Toolbox en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!