Profiler vs stopwatch timer functions

3 ビュー (過去 30 日間)
Geoff
Geoff 2012 年 8 月 8 日
Hello everyone !
I have just finished optimizing a code and I'd like to know the reason why there's a difference between the 'elapsed time' returned by the tic and toc timers (respectively put at the beginning and the end of my code) and the result printed by the profiler. For instance, why do I have 17 seconds for the 'elapsed time' and 27 seconds with the profiler ?
I also specify that nothing runs in the background of my system.
Thanks a lot !

採用された回答

Walter Roberson
Walter Roberson 2012 年 8 月 8 日
profiler restricts to a single thread, and disables some optimizations.
  1 件のコメント
Daniel Shub
Daniel Shub 2012 年 8 月 8 日
I agree this could be the cause if the code was run twice: once with the profiler and once surrounded by tic/toc. If the code was only run once with the profiler running on code surrounded by tic/toc, then the numbers should be close.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeProblem-Based Optimization Setup についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by