Mercurial > hg > ishara
annotate sched/timer_wait.m @ 29:61921dceded1
More documentation on type system.
author | samer |
---|---|
date | Sat, 19 Jan 2013 17:56:21 +0000 |
parents | 7357e1dc2ad6 |
children |
rev | line source |
---|---|
samer@2 | 1 % timer_wait - Wait for timer to stop running |
samer@0 | 2 % |
samer@2 | 3 % timer_wait :: timer => void. |
samer@2 | 4 % timer_wait :: timer, nonneg ~'time quantum for waiting' => void. |
samer@0 | 5 % |
samer@0 | 6 % If no wait quantum is supplied, the default is 50ms. |
samer@0 | 7 |
samer@2 | 8 function timer_wait(T,dt) |
samer@0 | 9 |
samer@0 | 10 if nargin<2, dt=0.05; end |
samer@0 | 11 while isvalid(T) && strcmp(T.Running,'on') |
samer@0 | 12 pause(dt); |
samer@0 | 13 end |
samer@0 | 14 end |