Board index » jbuilder » Put thread to sleep, thread impl.
Raydog
JBuilder Developer |
Put thread to sleep, thread impl.2004-09-14 12:12:49 PM jbuilder5 Hi all, I am doing a thread project, and i want the main thread to sleep for 10 sec, in ANSI C, just do sleep(10); will put the main thread to sleep, how can I put the java main to sleep ? or any thread, say class Worker implements Runnable. then use new Thread(workerInstance, "threadID").start(); to start threads, how can put a worker to sleep inside the Worker ? (I use a while loop to check connection in a Worker, but i want it to check every 1 sec) besides, what is the benefits 'class Worker extends Thread' over 'class Worker implements Runnable' expect the fact that you can extends only one super class, but you can implement many. Thanks so much, raydog |