Hum, I don't understand.
So you say that using a timer, is the same as using a sleep in a loop, because it will block the loop?
I made a test, try each code and you'll see that it isn't the same :
So you say that using a timer, is the same as using a sleep in a loop, because it will block the loop?
I made a test, try each code and you'll see that it isn't the same :
PHP Code:
; loop with a Sleep in it
Global $i
While 1
$i+=1
ToolTip("Number : " & $i,5,0)
Sleep(5000)
WEnd
; loop using a timer in it
Global $i, $begin
$begin = TimerInit()
While 1
$i+=1
ToolTip("Number : " & $i,5,0)
If TimerDiff($begin) >= 5000 Then
; your function to lunch after waiting 28 secs
$begin = TimerInit()
EndIf
Sleep(10) ; to avoid a UC overloaded
WEnd