Java Sleep sleepSilently(int millis)

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

Description

Attempts to sleep for the specified amount of milliseconds.

License

Open Source License

Parameter

Parameter Description
millis The amount of milliseconds to sleep

Declaration

public static void sleepSilently(int millis) 

Method Source Code

//package com.java2s;
/*/*w w w .ja v a  2  s .com*/
 * Copyright (C) 2016 Sebastian Hjelm
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation; either version 3
 * of the License, or (at your option) any later version.
 */

public class Main {
    /**
     * Attempts to sleep for the specified amount of milliseconds. Any
     *  {@link InterruptedException} are caught and discarded.
     * @param millis The amount of milliseconds to sleep
     */
    public static void sleepSilently(int millis) {
        try {
            Thread.sleep(millis);
        } catch (InterruptedException e) {
        }
    }
}

Related

  1. sleepQuite(long millis)
  2. sleepRandMs(int ms)
  3. sleepRandom(long floor, long ceiling)
  4. sleepRandom(long timeout)
  5. sleepSafely(final long millis)
  6. sleepSilently(int millis)
  7. sleepThread(long millSecd)
  8. sleepThread(long sleeptime)
  9. sleepTight(final long millis)