Champak Posted July 10, 2008 Posted July 10, 2008 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.
Andreik Posted July 11, 2008 Posted July 11, 2008 I don`t think if exist any limitation, but most probably not.
BrettF Posted July 11, 2008 Posted July 11, 2008 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 Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now