Sign in to follow this  
Followers 0
Champak

Timer limit

3 posts in this topic

Is there a limit, either autoit, OS, or whatever, in HOW MANY timers can be run at the same time? Or will multiple timers in an app use up too much CPU. The way I'm thinking of setting up the next feature in my app, based on user input, an unknown number of timers may run at the same time. So before I go down that path, just curious of any limitations that may cause problems.

Share this post


Link to post
Share on other sites



I don`t think if exist any limitation, but most probably not.


When the words fail... music speaks

Share this post


Link to post
Share on other sites

Well here's four. No limit yet.

$timer1 = TimerInit ()
Sleep (500)
$timer2 = TimerInit ()
Sleep (500)
$timer3 = TimerInit ()
Sleep (500)
$timer4 = TimerInit ()

While 1
    $timekeep1 = TimerDiff ($timer1)
    $timekeep2 = TimerDiff ($timer2)
    $timekeep3 = TimerDiff ($timer3)
    $timekeep4 = TimerDiff ($timer4)
    $text = "!------- Timer Results ---------" & @CRLF
    $text &= "#" & @TAB & "Timer 1 = " & $timekeep1 & @CRLF
    $text &= "#" & @TAB & "Timer 2 = " & $timekeep2 & @CRLF
    $text &= "#" & @TAB & "Timer 3 = " & $timekeep3 & @CRLF
    $text &= "#" & @TAB & "Timer 4 = " & $timekeep4 & @CRLF
    ConsoleWrite ($text)
    If $timekeep1 >= 5000 Then
        ConsoleWrite ("!-----------------Timer 1 Ended--------------" & @CRLF)
        Exit
    ElseIf $timekeep2 >= 5000 Then
        ConsoleWrite ("!-----------------Timer 2 Ended--------------" & @CRLF)
        Exit
    ElseIf $timekeep3 >= 5000 Then
        ConsoleWrite ("!-----------------Timer 3 Ended--------------" & @CRLF)
        Exit
    ElseIf $timekeep4 >= 5000 Then
        ConsoleWrite ("!-----------------Timer 4 Ended--------------" & @CRLF)
        Exit
    EndIf
WEnd

Because of how the timers are set up, I imagine there wouldn't be one.

See?

$timer1 = TimerInit ()
MsgBox (0, "", $timer1)

The helpfile says it returns "Returns a timestamp number (in milliseconds)."

TimerDiff ($timestamp) just calculates the time from the timestamp.... muttley

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0