Here you can find the source of sleep(long durationMillis)
public static void sleep(long durationMillis)
//package com.java2s; //License from project: Apache License import java.util.concurrent.TimeUnit; public class Main { public static void sleep(long durationMillis) { try {//from ww w . j a va 2 s. com Thread.sleep(durationMillis); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } public static void sleep(long duration, TimeUnit unit) { try { Thread.sleep(unit.toMillis(duration)); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } }