Here you can find the source of sleep(long timeToSleep)
Parameter | Description |
---|---|
timeToSleep | in milliseconds |
public static void sleep(long timeToSleep)
//package com.java2s; //License from project: Apache License public class Main { /**//ww w. ja v a 2s . c o m * Sleep and wake on InterruptedException * @param timeToSleep in milliseconds */ public static void sleep(long timeToSleep) { if (timeToSleep <= 0) return; try { Thread.sleep(timeToSleep); } catch (InterruptedException e) { } } }