Here you can find the source of sleep(long ms)
private static void sleep(long ms)
//package com.java2s; /******************************************************************************* * Copyright Duke Comprehensive Cancer Center and SemanticBits * //from w w w . ja v a 2 s. c o m * Distributed under the OSI-approved BSD 3-Clause License. * See http://ncip.github.com/c3pr/LICENSE.txt for details. *******************************************************************************/ public class Main { private static void sleep(long ms) { Object sleep = new Object(); try { synchronized (sleep) { sleep.wait(ms); } } catch (Exception e) { e.printStackTrace(); } } }