Java Sleep sleepAndIgnoreInterrupts(int millis)

Here you can find the source of sleepAndIgnoreInterrupts(int millis)

Description

Sets the current thread to sleep.

License

Open Source License

Declaration

public static void sleepAndIgnoreInterrupts(int millis) 

Method Source Code

//package com.java2s;

public class Main {
    /**//  ww w  .ja  v  a2 s.c  o  m
     * Sets the current thread to sleep. Use this method with care because InterruptedExceptions interrupt the sleep but
     * are not re-thrown.
     */
    public static void sleepAndIgnoreInterrupts(int millis) {
        try {
            Thread.sleep(millis);
        } catch (InterruptedException e1) {
            // ignore interrupts
            // be aware that the exception is not thrown again, thus the sleeping thread is not interrupted
        }
    }
}

Related

  1. sleep4Subscription()
  2. sleep_force(long timeToSleep)
  3. sleepABit(long millis)
  4. sleepABitMore()
  5. sleepAfterListItems()
  6. sleepAtLeast(long milliseconds)
  7. sleepAtLeast(long milliseconds)
  8. sleepBeforeRetry(int attemptNumber)
  9. sleepButInterruptable(long msecs)