Here you can find the source of sleep(Integer seconds)
public static void sleep(Integer seconds)
//package com.java2s; /*//from w ww . java 2 s . co m * Copyright 2014 University of Washington * * Licensed under the Educational Community License, Version 1.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.opensource.org/licenses/ecl1.php * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ public class Main { public static void sleep(Integer seconds) { // sanity check if (seconds == null || seconds <= 0 || seconds > 60) { return; } try { Thread.sleep(1000 * seconds); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); } } public static void sleep() { Integer wait = Integer.getInteger("w"); if (wait == null) { wait = Integer.getInteger("wait"); } sleep(wait); } }