Here you can find the source of sleep(int duration, TimeUnit unit)
static void sleep(int duration, TimeUnit unit)
//package com.java2s; /******************************************************************************* * Copyright (c) 2015-2016 Apcera Inc. All rights reserved. This program and the accompanying * materials are made available under the terms of the MIT License (MIT) which accompanies this * distribution, and is available at http://opensource.org/licenses/MIT *******************************************************************************/ import java.util.concurrent.TimeUnit; public class Main { static void sleep(int timeout) { sleep(timeout, TimeUnit.MILLISECONDS); }// ww w . j a v a 2 s . c om static void sleep(int duration, TimeUnit unit) { try { unit.sleep(duration); } catch (InterruptedException e) { /* NOOP */ } } }