Wait 5 secs in a loop
Posted 17 January 2008 - 22:16
I want to wait n seconds while running a loop.
Something like this -
startTime = Currenttime(); // this will set x to the current time
do some work here.....
diffTime = Currenttime() - StartTime;
until (diffTime = 5)
What is the easiest way to do it?
Posted 17 January 2008 - 22:49
Actually, I'm waiting for a custom process to finish, but if it hang, I want to abort after 5 or 10 secs. Delay() won't help me in this case.
Posted 22 January 2008 - 22:25
ie (assuming correct declarations)
returnValue = LaunchApp (myApp, myArgs );
if returnValue < 0 then
// error handling/messaging here
Check the LaunchApp or LaunchAppAndWait documentation.
Edited by daengh, 22 January 2008 - 22:26.
Posted 23 January 2008 - 08:23
This could have been the solution but I can't tell if 5 secs is enough. It could be between 5-60 secs and I don't want the user to wait for nothing, because it can return in 2 secs as well.
Also, I would like to do something while I'm waiting...
Posted 24 January 2008 - 11:36