Pause between two commands without using the SLEEP() command

Hi All,

I have a service running that monitors other services and restarts them when needed. After starting I check if the start is successful. Works fine.

But today I added a service that apparently takes a bit more time to start so my check if the start was successful comes to early. So I need a kind of delay between those two lines. I don’t want to use the SLEEP() command in the case. As far as I know that would delay the whole application which is not good it will also confuse the timer event which has to fire every three minutes.

Is there some other way I can get a delay between to commands instead of using SLEEP()? I guess a delay of 300ms will be sufficient.

AFAIK, it only affects the current thread.

OK that is good to know, thanks. Unfortunate that doesn’t help in this case because this application has just one thread. The checking and starting is done in a UserEvent on the main procedure.

On the newsgroup I got a pragmatic solution: Why not wait for the next timed event to check if the restart worked? For a non-essential service that might be ok.