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.

文章標籤
全站熱搜
創作者介紹
創作者 mark528 的頭像
mark528

狐的窩

mark528 發表在 痞客邦 留言(0) 人氣(37)