For a good night's sleep wear comfortable loose clothes, do not consume coffee or tea after 6:00 PM, and read something relaxing before going to bed. ok that's cool, but what if you want to put your Java Thread to sleep? Before Java SE 5, the most common way to put threads to sleep was by calling the sleep() method. System.out.println ( "Sleeping for 150 ms" ) ; Thread.sleep ( 150 ) ; System.out.println ( "Sleeping for 2 seconds" ) ; Thread.sleep ( 2 * 1000 ) ; System.out.println ( "Sleeping for 50 nanoseconds" ) ; Thread.sleep ( 0 , 50 ) ; Java2html The sleep() method takes a long parameter that represents the milliseconds we want the thread to sleep. If the time we want our thread to sleep can be easily represented in ms, then this method works out well, but if we want the thread to sleep for some sec...
Write Awesome User Manuals and Tutorials for Software Products