Here you can find the source of sleep(long millis)
Parameter | Description |
---|---|
millis | time in milliseconds |
public static boolean sleep(long millis)
//package com.java2s; //License from project: LGPL public class Main { /**/*from ww w . j a v a 2s .c o m*/ * Sleep without throwing an exception. * * @param millis time in milliseconds * @return true if not interrupted */ public static boolean sleep(long millis) { try { Thread.sleep(millis); return true; } catch (InterruptedException e) { return false; } } }