MATLAB Answers


Difference between MATLAB tic-toc time and actual time measured with a stop watch

Asked by Mohsin Shah on 30 Jul 2017
Latest activity Commented on by Mohsin Shah on 2 Aug 2017
Hello, this may seem stupid but I tried to check the time measured by tic-toc and the actual time measured with the help of stop watch for a certain program. I was surprised that tic-toc displayed about 4 minutes and my real world stop watch showed about 11 minutes. Can someone explain this mystery to me?


Show 1 older comment
@Stephen Cobeldick: tic is at the very top of the code and toc is at the end of the code. They are not inside a function and are not in the middle of the script.
has there been any delay in the output ? It seems weird that matlab is off by such a large amount
May be I can note the time for every function and script and then take the sum. In this way, I can figure it out I guess.

Sign in to comment.


1 Answer

Rob Campbell 님의 답변 1 Aug 2017
 채택된 답변

You could also try "profview" if you want to see what's taking the time in your function. You'll get loads of detailed information and even hints on how to speed stuff up.


Sign in to comment.