function DealTimer(Type,TimerName) % 处理Timer工具类 % by qm % Email:[email protected] % 2015/09/09 % Type : 动作类型 1 :启动Timer 2 : 停止Timer 3:删除Timer
%% 输入输出预处理 if nargin < 1 || isempty(Type) Type = 3; end if nargin < 2 TimerName = ''; end if 1 == Type if ~isempty(TimerName) ts=timerfind('Name',TimerName); else ts=timerfind; end if length(ts)>0 start(ts); end end
if 2 == Type if ~isempty(TimerName) ts=timerfind('Name',TimerName); else ts=timerfind; end if length(ts)>0 stop(ts); end end
if 3 == Type if ~isempty(TimerName) ts=timerfind('Name',TimerName); else ts=timerfind; end if length(ts)>0 stop(ts); delete(ts); end end
近期评论