by jesse

What is the easiest way to pause execution of a program in java, without threads?

well, the title lies, it does actualy use threads, but the class does not have to extend java.lang.thread, or anything else. so here it is: Thread.currentThread().sleep(int); and now, a brief explanation, Thread.currentThread() returns an instance of the caller, as a thread, even when the caller isnt a thread, its a bagel, or an applet. you could just as easily use stop, or pause instead of sleep also.

 


 
Read more of   The Yak's Frequently Questioned Answers   (mod.2008-06-12)

410.   What is naked sushi? What is Nyataimori? What is Nyotaimori? Or how do I ask for a "Naked Sushi" bar?   [jake/2006-05-21] ( novalis/2005-03-30 )
383.   How do I translate to and from Japanese?   [novalis/2003-09-25]
339.   R. U. ready to Impeach the Entire Political Mainstream and Dramatically Decrease the Threat of International Terrorism?   [strick/2002-12-06]
307.   Where the hell is #yak?   [vonguard/2002-02-07]
279.   How do I get my USB digital camera to work under Linux?   [rupe/2001-10-29]
277.   What does K-Rad mean? is there a modern alternative to k-rad?   [mennonite/2001-10-08]
210.   Where can i get a cool e-mail alias @jonfram.net or @nakedpudding.com?   [josh/2001-04-04]
178.   Why isn't my PCS email working on my Cingular/PB Wireless phone?   [rupe/2001-02-12]
140.   What was programming the Royal McBee LGP-30 like?   [rupe/2000-10-25]
32.   What are the 'mailer' flags (on the M lines) inside sendmail.cf ?   [strick/2000-01-25]