function f=pauser(varargin)
% pauser - Return function to pause or not depending on options
%
% pauser :: options {
%    pause :: natural/0 ~'0 for no pause, 1 pause, >10 for ms pause';
%    drawnow :: {0,1}/1 ~'call drawnow to flush graphics'
% } -> (void => void) ~'function to pause or not'.
%
% pauser(opts) returns a function that does exactly what optpause(opts)
% does.

	opt=options(varargin{:});
	ps=getparam(opt,'pause',0);
	dn=getparam(opt,'drawnow',1);
	if ps, 
		if ps<10, f=@pause;
		else wait=ps/1000; f=@()pause(wait); 
		end 
	elseif dn, f=@drawnow;
	else f=@nop;
	end
