Java Utililty Methods Sleep

List of utility methods to do Sleep

Description

The list of methods to do Sleep are organized into topic(s).

Method

voidsleep()
sleep
try {
    Thread.sleep(1000);
} catch (InterruptedException e) {
    throw new RuntimeException(e);
Thread.yield();
voidsleep()
sleep
try {
    Thread.sleep(1000 * 5);
} catch (Exception e) {
voidsleep()
sleep
try {
    Thread.sleep(MINUTE);
} catch (InterruptedException e) {
voidsleep()
sleep
Thread.sleep(1000);
voidsleep()
sleep
sleep(TIMEOUT);
voidsleep(double numSeconds)
Cause the current thread to sleep for numSeconds.
assert numSeconds >= 0.0 : "numSeconds must be >= 0.0";
try {
    Thread.sleep((int) (numSeconds * 1000.0));
} catch (InterruptedException e) {
voidsleep(double seconds)
sleep.
sleep(Math.round(1000 * seconds));
voidsleep(double secs)
sleep
try {
    Thread.sleep((long) (1000 * secs)); 
} catch (InterruptedException ex) {
    System.out.print("something is wrong exception 1");
    Thread.currentThread().interrupt();
booleansleep(final int millis)
Sleeps the current thread, useful to handle interrupted exceptions.
try {
    Thread.sleep(millis);
    return true;
} catch (final InterruptedException e) {
    Thread.currentThread().interrupt();
    return false;
voidsleep(final int ms)
Sleep my little class.
final Object monitor = new Object();
synchronized (monitor) {
    try {
        monitor.wait(ms);
    } catch (InterruptedException e) {