Here you can find the source of sleep(long millis)
public static void sleep(long millis)
//package com.java2s; /*// w w w . java 2s.co m * Copyright (c) 2007-2009, 2011-2013, 2015, 2016 Eike Stepper (Berlin, Germany) and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Eike Stepper - initial API and implementation */ public class Main { public static void sleep(long millis) { try { Thread.sleep(millis); } catch (InterruptedException ex) { return; } } public static void sleep(long millis, int nanos) { try { Thread.sleep(millis, nanos); } catch (InterruptedException ex) { return; } } }