Here you can find the source of sleep(long time)
Parameter | Description |
---|---|
time | time in milliseconds to make the thread to sleep |
public static void sleep(long time)
//package com.java2s; //License from project: LGPL public class Main { /**//from w w w. java 2 s . c o m * Since sleeps are sometimes necessary, this makes * an easy way to ignore InterruptedException's. * * @param time time in milliseconds to make the thread to sleep */ public static void sleep(long time) { try { Thread.sleep(time); } catch (InterruptedException e) { // reset interrupted status Thread.currentThread().interrupt(); } } }