Java tutorial
//package com.java2s; public class Main { /** * Puts a thread to sleep, without throwing an InterruptedException. * * @param ms the length of time to sleep in milliseconds */ public static void sleep(long ms) { try { Thread.sleep(ms); } catch (InterruptedException iex) { // ignore } } /** * Puts a thread to sleep forever. */ public static void sleep() { try { Thread.sleep(Long.MAX_VALUE); } catch (InterruptedException iex) { // ignore } } }