I want my program to update a label every 500ms.
do while <some condition>
'cpu intensive stuff here mainly string manipulation
label1.text=somestring
doevents
sleep(500)
loop
The problem is that the heavy cpu stuff takes up to 200ms or so, leading
to variation in delay between label updates, when I need it to be
smooth, from a visual perspective.
I replaced the sleep, instead after updating the form I start a timer,
then do the string processing, and then waiting for the timer to expire
before the label update, but get the same result.
do while ...
'cpu intensive stuff
do while tmr1.enabled=true
doevents
loop
label1.text=somestring
tmr1.enabled=true
loop
sub tmr1_tick
tmr1.enabled=false
end sub
The cpu intensive stuff appears to affect when the timer expires. Should
I be looking at the date/time functions to look for absolute rather than
relative times? If so, any pointers to help me?
Steve
do while <some condition>
'cpu intensive stuff here mainly string manipulation
label1.text=somestring
doevents
sleep(500)
loop
The problem is that the heavy cpu stuff takes up to 200ms or so, leading
to variation in delay between label updates, when I need it to be
smooth, from a visual perspective.
I replaced the sleep, instead after updating the form I start a timer,
then do the string processing, and then waiting for the timer to expire
before the label update, but get the same result.
do while ...
'cpu intensive stuff
do while tmr1.enabled=true
doevents
loop
label1.text=somestring
tmr1.enabled=true
loop
sub tmr1_tick
tmr1.enabled=false
end sub
The cpu intensive stuff appears to affect when the timer expires. Should
I be looking at the date/time functions to look for absolute rather than
relative times? If so, any pointers to help me?
Steve