- >>doc timeit
- >>doc profile
How to compute execution time?
2 ビュー (過去 30 日間)
古いコメントを表示
I am executing a MatLab program. I used tic-toc to compute execution time. BUT each time I got a different time? Why?
0 件のコメント
回答 (2 件)
Muthu Annamalai
2015 年 7 月 28 日
Have you tried,
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
Image Analyst
2015 年 7 月 29 日
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.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Get Started with MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!