網頁

2012年3月24日 星期六

Pausing Execution with Sleep in java

Thread.sleep causes the current thread to suspend execution for a specified period.

//Pause for 5 seconds
Thread.sleep(5000);

InterruptedException is an exception that sleep throws when another thread interrupts the current thread while sleep is active.

沒有留言:

張貼留言