Here you can find the source of sleep()
public static void sleep()
//package com.java2s; import java.util.concurrent.TimeUnit; public class Main { public static void sleep() { sleep(10);/*www . j a va 2 s . c o m*/ } public static void sleep(int millis) { try { TimeUnit.MILLISECONDS.sleep(millis); } catch (InterruptedException e) { e.printStackTrace(); throw new RuntimeException(e.getMessage(), e); } } }