List of utility methods to do Sleep
void | sleepForever() A really bad way to keep a thread waiting. while (true) {
Thread.sleep(10000);
Thread.yield();
|
void | sleepForever() sleep Forever sleep(Long.MAX_VALUE); |
void | sleepForever() sleep Forever while (true) { try { Thread.sleep(Long.MAX_VALUE); } catch (InterruptedException e) { |
void | sleepForIOCatchup() sleep For IO Catchup System.out.println("Waiting 10 seconds for I/O to catch up and properly close async appenders."); try { Thread.sleep(10000); } catch (InterruptedException ie) { System.err.println("Interrupted while waiting for I/O to catch up."); |
void | sleepForReal(long time) sleep For Real long end = System.currentTimeMillis() + time; while (true) { long now = System.currentTimeMillis(); if (now >= end) return; Thread.sleep(end - now); |
void | sleepForSecs(double numSecs) sleep For Secs try { Thread.sleep((long) (numSecs * 1000)); } catch (InterruptedException e) { |
void | sleepForSomeTime(long milliseconds) sleep For Some Time try { Thread.sleep(milliseconds); } catch (InterruptedException ignore) { |
void | sleepForTimestamp() sleep For Timestamp if (!ourIsSleepForTimeStamp) { return; long time = System.currentTimeMillis(); time = 1100 - (time - (time / 1000) * 1000); try { Thread.sleep(time); } catch (InterruptedException e) { ... |
void | sleepIgnoreInterupt(long millis) sleep Ignore Interupt try { Thread.sleep(millis); } catch (InterruptedException e) { |
void | sleepInterruptible(long timeMillis) sleep Interruptible try { Thread.sleep(timeMillis); } catch (InterruptedException e) { |