pugboy Posted August 24, 2008 Share Posted August 24, 2008 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 More sharing options...
Andreik Posted August 24, 2008 Share Posted August 24, 2008 (edited) 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 August 25, 2008 by Andreik When the words fail... music speaks. Link to comment Share on other sites More sharing options...
pugboy Posted August 24, 2008 Author Share Posted August 24, 2008 Doh! I forgot about the timer functions... Thanks! Link to comment Share on other sites More sharing options...
Emiel Wieldraaijer Posted August 24, 2008 Share Posted August 24, 2008 I don't think timerinit and timerdiff can do the trick .. timerinit is used to mark a time which can be used for counting timerdiff is the difference between timerinit and calling timerdiff Best regards,Emiel Wieldraaijer Link to comment Share on other sites More sharing options...
pugboy Posted August 25, 2008 Author Share Posted August 25, 2008 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 More sharing options...
Achilles Posted August 25, 2008 Share Posted August 25, 2008 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. My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted August 25, 2008 Share Posted August 25, 2008 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() .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
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