Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Linux / UNIX and the fly likes using wait & sleep Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "using wait & sleep" Watch "using wait & sleep" New topic

using wait & sleep

Minal Silimkar-Urankar
Ranch Hand

Joined: Nov 25, 2007
Posts: 136
I tried sleep & wait command as shown below.

In the script, there are two while loops. Each is having sleep command.
first loop is going in the sleep for 5 seconds and second loop is going in the loop for 2 seconds. I want when first loop goes in the sleep second loop should start it's execution & when second goes in the sleep first should start the execution.

But after execution it completes first_loop and then starts second_loop execution.

[ June 20, 2008: Message edited by: minal silimkar ]

Minal Silimkar
I agree. Here's the link:
subject: using wait & sleep
It's not a secret anymore!