Mercurial > hg > ishara
annotate general/algo/optpause.m @ 8:f0a3d7d7a0e3
Renamed cat_sep function to catsep
author | samer |
---|---|
date | Mon, 14 Jan 2013 14:54:10 +0000 |
parents | e44f49929e56 |
children | 03694e5c8365 |
rev | line source |
---|---|
samer@4 | 1 function optpause(opt) |
samer@4 | 2 % optpause - Optionally pause and/or update graphics |
samer@4 | 3 % |
samer@4 | 4 % optpause :: struct { |
samer@4 | 5 % pause :: natural/0 ~'0-nopause, 1-pause, N-timed pause in ms'; |
samer@4 | 6 % drawnow :: bool/0 ~'flush graphics before pausing' |
samer@4 | 7 % } => void. |
samer@4 | 8 |
samer@4 | 9 ps=getparam(opt,'pause',0); |
samer@4 | 10 dn=getparam(opt,'drawnow',1); |
samer@4 | 11 if ps, |
samer@4 | 12 if ps>=10, pause(ps/1000); else pause; end |
samer@4 | 13 elseif dn, drawnow; |
samer@4 | 14 end |