stop, timer.stop
Stop a running timer object.
📝Syntax
stop(t)
📥Input Arguments
Parameter Description
t Timer object or timer object array.
📄Description

stop stops running timers. If a timer has a StopFcn, Nelson executes it when the timer transitions from running to stopped.

Calling stop on a timer that is already stopped leaves the timer stopped.

💡Examples
Stop a repeated timer before it reaches its task limit.
t = timer('ExecutionMode', 'fixedSpacing', ...
  'Period', 0.2, ...
  'TasksToExecute', Inf, ...
  'TimerFcn', @(src, event) disp('tick'), ...
  'StopFcn', @(src, event) disp('stopped'));
start(t);
sleep(0.35);
stop(t);
delete(t);
🔗See Also
timerstartwait
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub