List of utility methods to do Sleep
void | sleep(long millis) sleep long sleepStartedAt = System.currentTimeMillis(); try { Thread.sleep(millis); } catch (InterruptedException exception) { long sleepInterruptedAt = System.currentTimeMillis(); long remainingSleepTime = millis - (sleepInterruptedAt - sleepStartedAt); sleep(remainingSleepTime); |
boolean | sleep(Long millis) sleep if (millis == null || millis <= 0) { return true; try { Thread.sleep(millis); } catch (InterruptedException e) { return false; return true; |
void | sleep(long millis) sleep if (millis <= 0) { if (millis < 0) { throw new IllegalArgumentException("" + millis); return; long end = System.currentTimeMillis() + millis; do { ... |
void | sleep(long millis) sleep long start; long end; long remaining = millis; do { start = System.nanoTime(); try { Thread.sleep(remaining); remaining = 0; ... |
void | sleep(long millis) Sleep thread without exception. try { Thread.sleep(millis); } catch (Throwable e) { e.printStackTrace(); |
void | sleep(long millis) Sleep and catch the interrupted exception. try { Thread.sleep(millis); } catch (InterruptedException e) { |
void | sleep(long millis) sleep try { Thread.sleep(millis); } catch (InterruptedException interruptedException) { throw new RuntimeException("Unable to sleep for " + millis + " millis.", interruptedException); |
boolean | sleep(long millis) Sleep without throwing an exception. try { Thread.sleep(millis); return true; } catch (InterruptedException e) { return false; |
void | sleep(long millis) Causes the currently executing thread to sleep (temporarily cease execution) for the specified number of milliseconds. try { Thread.sleep(millis); } catch (InterruptedException e) { |
void | sleep(long millis) sleep try { Thread.sleep(millis); } catch (Throwable ignored) { |