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