List of utility methods to do Sleep
void | sleep(int sleepInSeconds) sleep if (sleepInSeconds > 0) { try { Thread.sleep(1000 * sleepInSeconds); } catch (InterruptedException e) { |
void | sleep(int toSleep) sleep try { long start = System.currentTimeMillis(); Thread.sleep(toSleep); long now; while (start + toSleep > (now = System.currentTimeMillis())) Thread.sleep(start + toSleep - now); } catch (InterruptedException e) { e.printStackTrace(); ... |
void | sleep(Integer seconds) sleep if (seconds == null || seconds <= 0 || seconds > 60) { return; try { Thread.sleep(1000 * seconds); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); |
void | sleep(Integer threadWaitInMs) Sleeps the thread for thread_wait_in_ms milliseconds.
if ((threadWaitInMs != null) && (threadWaitInMs > 0)) try { Thread.sleep(threadWaitInMs); } catch (Exception e) { |
void | sleep(long duration) sleep int count = 0; while (count < duration) { try { Thread.sleep(1000); count++; } catch (InterruptedException e) { |
boolean | sleep(long interval) Sleeps the given interval of time given in milliseconds. boolean result = true; try { Thread.sleep(interval); } catch (InterruptedException ex) { result = false; return result; |
void | sleep(long l) Small Utility to consume the InterruptedException associated wiht Thread.sleep try { Thread.sleep(l); } catch (final InterruptedException e) { |
void | sleep(long milli) Same as Thread#sleep(long) except Exception is caught and ignored. try { Thread.sleep(milli); } catch (InterruptedException e) { Thread.currentThread().interrupt(); |
void | sleep(long millions) sleep try { Thread.currentThread().sleep(millions); } catch (InterruptedException e) { e.printStackTrace(); |
void | sleep(long millis) Utility method that causes the current thread to sleep. long past = System.currentTimeMillis(); long future = past + millis; long now = past; if (TRACE) { System.err.println("Sleeping for " + millis + "ms"); while (now < future) { try { ... |