Mercurial > hg > ishara
diff sched/timer_wait.m @ 0:672052bd81f8
Initial partial import.
author | samer |
---|---|
date | Wed, 19 Dec 2012 22:38:28 +0000 |
parents | |
children | 7357e1dc2ad6 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sched/timer_wait.m Wed Dec 19 22:38:28 2012 +0000 @@ -0,0 +1,14 @@ +% waitfortimer - Wait for timer to stop running +% +% waitfortimer :: timer -> action unit. +% waitfortimer :: timer, nonneg ~'time quantum for waiting' -> action unit. +% +% If no wait quantum is supplied, the default is 50ms. + +function waittimer(T,dt) + + if nargin<2, dt=0.05; end + while isvalid(T) && strcmp(T.Running,'on') + pause(dt); + end +end