필터 지우기
필터 지우기

what's the time of pause(1)

조회 수: 92 (최근 30일)
Eman Ahmed Elsayed
Eman Ahmed Elsayed 2011년 6월 8일
is this time equal 1 s??

답변 (2개)

Paulo Silva
Paulo Silva 2011년 6월 8일
pause(n) pauses execution for n seconds before continuing, where n can be any nonnegative real number. The resolution of the clock is platform specific. A fractional pause of 0.01 seconds should be supported on most platforms. Pausing must be enabled for this to take effect.

Matt Fig
Matt Fig 2011년 6월 8일
Try this:
tic,pause(1),toc
The elapsed time should be slightly over 1 second, due to calling the pause function and other overhead.
  댓글 수: 3
Matt Fig
Matt Fig 2011년 6월 9일
Built-in functions don't show in the profiler... at least in 2007b.
Also, I have noticed that the profiler total time run per function, or even per line of code is completely useless. For example, when looking at the profile of running an M-file which I know took less than 2 seconds to run, I see it saying things like REPMAT took 3.5 seconds alone, and meshgrid took 2.8 seconds - rubbish!
I only look at the relative times run to get useful information.
Paulo Silva
Paulo Silva 2011년 6월 9일
I'm with the version 2008b and I can profile just the pause(1), it takes an average of 1.009 seconds, I'm also a fan of the tic and toc functions instead of the profiler

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by