Here you can find the source of sleep(long ms)
public static boolean sleep(long ms)
//package com.java2s; public class Main { public static boolean sleep(long ms) { try {/* w w w .j ava2 s . c om*/ if (ms > 0) { Thread.sleep(ms); } return true; } catch (InterruptedException e) { return false; } } }