Java Sleep sleep(long time)

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

Description

Since sleeps are sometimes necessary, this makes an easy way to ignore InterruptedException's.

License

LGPL

Parameter

Parameter Description
time time in milliseconds to make the thread to sleep

Declaration

public static void sleep(long time) 

Method Source Code

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

public class Main {
    /**//from   w w w.  java  2 s  .  c o m
     * Since sleeps are sometimes necessary, this makes
     * an easy way to ignore InterruptedException's.
     * 
     * @param time time in milliseconds to make the thread to sleep
     */
    public static void sleep(long time) {
        try {
            Thread.sleep(time);
        } catch (InterruptedException e) {
            // reset interrupted status
            Thread.currentThread().interrupt();
        }
    }
}

Related

  1. sleep(long msecs, boolean busy_sleep)
  2. sleep(long msecs, boolean busy_sleep)
  3. sleep(long sleepTime)
  4. sleep(long sleepTime)
  5. sleep(long time)
  6. sleep(long time)
  7. sleep(long time)
  8. sleep(long timeToSleep)
  9. sleep4Subscription()