Jump to content

Timer Problems


Recommended Posts

Current Code:

$TStart = TimerInit()

;Main Loop

While 1
    $Timer = TimerDiff($TStart)
    If $Timer = 1000 Then
        MsgBox(0, "", "Time!!")
    EndIf
    Sleep(30)
WEnd

I would put the timerinit in the loop but then that would keep resetting it.

Link to comment
Share on other sites

With your prior post regarding multiple timers, I'd think you'd want to be resetting your timers in the loop via TimerInit()

$TStart1 = TimerInit()
$TStart5 = TimerInit()

;Main Loop

While 1
    If TimerDiff($TStart1) > 1000 Then
        ToolTip("Timer1")
        Beep(600,50)
        $TStart1 = TimerInit()
    EndIf
    If TimerDiff($TStart5) > 5000 Then
        ToolTip("Timer5")
        Beep(900,50)
        $TStart5 = TimerInit()
    EndIf
    ToolTip("")
WEnd
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...