File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Implementing sleep() like funtionality in a non threaded class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Implementing sleep() like funtionality in a non threaded class" Watch "Implementing sleep() like funtionality in a non threaded class" New topic
Author

Implementing sleep() like funtionality in a non threaded class

Jay Dilla
Ranch Hand

Joined: Aug 12, 2004
Posts: 199
What is the best approach to this?
Is it even possible?
I'm trying to find the sleep() implementation but now realizing it might not even be relevant if it's not a thread.
Are there any other java methods that pause action for a specified period of time?
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4240
    
    7

All code runs in a thread, so you can always call sleep() to wait for a while. Just be aware that if that's the only thread in the application then nothing will happen while it sleeps.
Gaurav Raje
Ranch Hand

Joined: Jul 23, 2010
Posts: 136
sleep will sleep a thread... regardless of whether other threads exist or not. Make sure you catch the exception
Jay Dilla
Ranch Hand

Joined: Aug 12, 2004
Posts: 199
yea saw i could use sleep still after i posted this....my bad!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Implementing sleep() like funtionality in a non threaded class
 
Similar Threads
I dont know what is it
Name Joke
Contacting chicken...
violence or non-violence
WA#2 word association