Java Sleep sleepUninterruptedly(long millis)

Here you can find the source of sleepUninterruptedly(long millis)

Description

Utility method that sleeps for a given time without interruption.

License

Open Source License

Parameter

Parameter Description
millis The number of milliseconds to sleep for.

Declaration

public static void sleepUninterruptedly(long millis) 

Method Source Code

//package com.java2s;
/**/*from   ww  w .  j av a  2 s .co  m*/
 * This class holds various utility methods.
 * 
 * @author Yanick Duchesne
 *         <dl>
 *         <dt><b>Copyright: </b>
 *         <dd>Copyright &#169; 2002-2003 <a
 *         href="http://www.sapia-oss.org">Sapia Open Source Software </a>. All
 *         Rights Reserved.</dd>
 *         </dt>
 *         <dt><b>License: </b>
 *         <dd>Read the license.txt file of the jar or visit the <a
 *         href="http://www.sapia-oss.org/license.html">license page </a> at the
 *         Sapia OSS web site</dd>
 *         </dt>
 *         </dl>
 */

public class Main {
    /**
     * Utility method that sleeps for a given time without interruption.
     * 
     * @param millis The number of milliseconds to sleep for.
     */
    public static void sleepUninterruptedly(long millis) {
        try {
            Thread.sleep(millis);
        } catch (InterruptedException ie) {
            // noop
        }
    }
}

Related

  1. sleepSilently(int millis)
  2. sleepSilently(int millis)
  3. sleepThread(long millSecd)
  4. sleepThread(long sleeptime)
  5. sleepTight(final long millis)
  6. sleepUninterruptibly(long msecs)
  7. sleepUntil(long time)
  8. sleepUntil(long timestamp)
  9. sleepUpTo(final long millis)