Java Sleep sleepForever()

Here you can find the source of sleepForever()

Description

sleep Forever

License

Apache License

Declaration

public static void sleepForever() 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static void sleepForever() {
        sleep(Long.MAX_VALUE);/*from  w w  w .ja v a  2 s  . c  om*/
    }

    /**
     * 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) {
        }
    }
}

Related

  1. sleepFor(int sleepDurationInMilliseconds)
  2. sleepFor(long millis)
  3. sleepForAuditGranularity()
  4. sleepForever()
  5. sleepForever()
  6. sleepForIOCatchup()
  7. sleepForReal(long time)
  8. sleepForSecs(double numSecs)
  9. sleepForSomeTime(long milliseconds)