Java Sleep sleepOrCry(long timeToWait)

Here you can find the source of sleepOrCry(long timeToWait)

Description

sleep Or Cry

License

Open Source License

Declaration

public static void sleepOrCry(long timeToWait) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static void sleepOrCry(long timeToWait) {
        sleepOrCry(timeToWait, null);//from ww w. j  a  va 2 s .  c  o m
    }

    public static void sleepOrCry(long timeToWait, String message) {
        try {
            Thread.sleep(timeToWait);
        } catch (InterruptedException e) {//NOSONAR
            if (message == null)
                throw new IllegalStateException(e);
            throw new IllegalStateException(message, e);
        }
    }
}

Related

  1. sleepNoShit(long nanos)
  2. sleepNotException(long millis)
  3. sleepNoThrow(long timeoutMs)
  4. sleepNs(int ns)
  5. sleepNS(long ns)
  6. sleepPeriod(double period)
  7. sleepQuietly(int millis)
  8. sleepQuietly(long millis)
  9. sleepQuietly(long millis)