Java Sleep sleep(long time)

Here you can find the source of sleep(long time)

Description

Sleep the specified number of milliseconds.

License

Open Source License

Declaration

public static boolean sleep(long time) 

Method Source Code

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

public class Main {
    /**//from   w  w w.  j a  va2 s.co  m
     * Sleep the specified number of milliseconds. A return value of false
     * indicates that the specified time was invalid or that an error occured
     * while sleeping.
     */
    public static boolean sleep(long time) {
        if (time <= 0)
            return true;
        try {
            Thread.sleep(time);
            return true;
        } catch (Exception ex) {
        }
        return false;
    }
}

Related

  1. sleep(long sleepTime)
  2. sleep(long sleepTime)
  3. sleep(long time)
  4. sleep(long time)
  5. sleep(long time)
  6. sleep(long timeToSleep)
  7. sleep4Subscription()
  8. sleep_force(long timeToSleep)
  9. sleepABit(long millis)