How to do something like a windows Sleep(ms)?
Hello, how to do a 10ms pause in a loop? Like in windows programming sleep(ms)
I need something like
for i=1 to end
do something here...
pause(1) ' 10ms pause for example
next i
I know about on_sys_timer but I am not sure if it can help me in this case at least not in a straightforward way, unless I am missibg something very obvious.
I need something like
for i=1 to end
do something here...
pause(1) ' 10ms pause for example
next i
I know about on_sys_timer but I am not sure if it can help me in this case at least not in a straightforward way, unless I am missibg something very obvious.
1
person has this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
Create a customer community for your own organization
Plans starting at $19/month
-
Inappropriate?Ciao
w=sys.timecount 'memorize time count at the beginning of waiting for serial data
do while true
if sys.timecount-w>20 then exit do 'we quit after 10 seconds
doevents 'polite waiting includes this
wend
This will count 10 seconds. The minimun is half a second
Another way to delay is:
dim delay as integer
sys.onsystimerperiod=10 ' each interrupt is 10ms put on initialization routines
sub on_sys_timer
delay=delay+1
if delay= 30000 then delay=0 ' to void runtime error maximum 300 seconds
end sub
sub delay(msdelay as integer)
delay=0 ' clear counter
do while true
doevents
if msdelay=delay then exit sub
loop
end sub
to pause 20ms
delay(2)
Hope it can help
Ciao
Mauro
Loading Profile...


