Jump to content

how to make a timer inside a loop


Smurfin
 Share

Recommended Posts

can anyone please teach me how to make a timer inside a main program loop, so the timer will only execute a certain function after like 30 minutes and the loops goes on without executing this one function again, only after the next 30 minutes it will be executed again.

thanks in advance.

Link to comment
Share on other sites

you could use adlibenable or

$timer=TimerInit()

$time=30*60*1000
While 1
    ToolTip(Round(TimerDiff($timer)/1000,2),0,0)
    If TimerDiff($timer)>$time Then
        $timer=TimerInit()
        MsgBox(0 , "" , "test msgbox")
    EndIf
    Sleep(10)
WEnd

now you just have to decide where to put the second timerinit

just after the if or just before the endif:P

Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...