Java Thread Pause pauseln(Object obj)

Here you can find the source of pauseln(Object obj)

Description

pauseln

License

Apache License

Declaration

public static void pauseln(Object obj) 

Method Source Code

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

public class Main {
    private static final long DEFAULT_SLEEP_TIME = 1000;

    public static void pauseln(Object obj) {
        System.out.println(obj);//from   w  ww.  j ava2s  . co m
        sleep(DEFAULT_SLEEP_TIME);
    }

    public static void println(Object obj) {
        System.out.println(obj);
    }

    @SuppressWarnings("static-access")
    public static void sleep(long time) {
        try {
            Thread.currentThread().sleep(time);
        } catch (InterruptedException e) {
            throw new RuntimeException("Thread [" + Thread.currentThread().getName() + "] was Interrupted", e);
        }
    }
}

Related

  1. pause(long milliseconds)
  2. pause(long nbMilliseconds)
  3. pause(long pause)
  4. pause(long t)
  5. pauseForTime(String pauseTime)
  6. pauseRequests(int length)
  7. pauseWaitUntil(long untilTargetTime)
  8. pauseWriteRecord()