Java tutorial
//package com.java2s; public class Main { public static void sleep(long millis) { if (millis > 0) { try { Thread.sleep(millis); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } } public static void sleep(int milliseconds, int nanoseconds) { try { Thread.sleep(milliseconds, nanoseconds); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } }