Jump to content

Sleeping withut Pausing


 Share

Recommended Posts

I need to wait X milliseconds before preforming the next action, but the sleep command will interfere with my tray menu... None of the buttons do anything, and I am guessing because the script is "Paused" with the sleep function.

Is there a function for waiting X milliseconds, without pausing the script (so my tray menu items can do something)?

Link to comment
Share on other sites

I need to wait X milliseconds before preforming the next action, but the sleep command will interfere with my tray menu... None of the buttons do anything, and I am guessing because the script is "Paused" with the sleep function.

Is there a function for waiting X milliseconds, without pausing the script (so my tray menu items can do something)?

Try with TimerInit() and TimerDiff().

Edited by Andreik

When the words fail... music speaks.

Link to comment
Share on other sites

No, it worked.

Func wait($milliseconds)
    $begin = TimerInit()
    While 1
        checkTray()
        if(timerDiff($begin) >= $milliseconds) Then
            ExitLoop
        EndIf
    WEnd
EndFunc

The checkTray() is the routine checking if any buttons were pressed in the tray menu.

Link to comment
Share on other sites

Using _Timer_SetUp (I think that's it's name) might work better because than you wouldn't need to check in you main loop.

That should be _Timer_SetTimer()
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...