Here you can find the source of sleep(long millis)
Parameter | Description |
---|---|
millis | a parameter |
Parameter | Description |
---|---|
RuntimeException | an exception |
public static void sleep(long millis) throws RuntimeException
//package com.java2s; //License from project: Open Source License public class Main { /**//from w w w . j a v a 2 s.c om * * @param millis * @throws RuntimeException */ public static void sleep(long millis) throws RuntimeException { try { Thread.sleep(millis); } catch (InterruptedException ex) { throw new RuntimeException(ex); } } /** * * @param millis * @param nanos * @throws RuntimeException */ public static void sleep(long millis, int nanos) throws RuntimeException { try { Thread.sleep(millis, nanos); } catch (InterruptedException ex) { throw new RuntimeException(ex); } } }