필터 지우기
필터 지우기

Does a timer stil run its callback function when pause is called from outside?

조회 수: 2 (최근 30일)
Hi,
If i set a timer to have an execution period of 1 second, and I do something like this:
start(timerObject)
pause(60)
stop(timerObject)
Will the timer's callback function execute during the 60 second pause?

채택된 답변

Jan
Jan 2013년 2월 20일
편집: Jan 2013년 2월 20일
Simply try it:
TimerH = timer('TimerFcn', 'disp(clock)', 'Period', 1, ...
'ExecutionMode', 'fixedSpacing', 'TasksToExecute', 10);
start(TimerH);
pause(20);
stop(TimerH);
You see the current time appearing every second even during the pause.
  댓글 수: 2
Mihai
Mihai 2013년 2월 20일
It certainly seems like the laziest question I've ever asked, but I didn't have access to matlab at the time! Thank you for your answer (once again).
Jan
Jan 2013년 2월 20일
You are welcome. And the question is not lazy: Writing the question and reading the answer took more time and energy than trying it by your own - when you have access to Matlab again ;-)
I was not sure also and had to try it also.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by