List of utility methods to do Sleep
void | sleepQuietly(long ms) sleep Quietly try { sleep(ms); } catch (InterruptedException ignored) { |
void | sleepQuite(long millis) Sleep quite try { Thread.sleep(millis); } catch (InterruptedException e) { |
void | sleepRandMs(int ms) sleep Rand Ms sleepMs((long) (Math.random() * ms));
|
void | sleepRandom(long floor, long ceiling) Sleeps between floor and ceiling milliseconds, chosen randomly if (ceiling - floor <= 0) { return; long diff = ceiling - floor; long r = (int) ((Math.random() * 100000) % diff) + floor; sleep(r); |
void | sleepRandom(long timeout) Sleeps between 1 and timeout milliseconds, chosen randomly. if (Thread.interrupted()) throw new InterruptedException(); if (timeout <= 0) { return; long r = (int) ((Math.random() * 100000) % timeout) + 1; sleep(r); |
void | sleepSafely(final long millis) Causes calling thread to sleep and ignores thrown InterruptedException. try { Thread.sleep(millis); } catch (final InterruptedException e) { |
void | sleepSilently(int millis) Attempts to sleep for the specified amount of milliseconds. try { Thread.sleep(millis); } catch (InterruptedException e) { |
void | sleepSilently(int millis) sleep Silently try { Thread.sleep(millis); } catch (InterruptedException e) { |
void | sleepThread(long millSecd) sleep Thread try { Thread.sleep(millSecd); } catch (InterruptedException e) { e.printStackTrace(); |
void | sleepThread(long sleeptime) Puts the current thread to sleep for the desired number of ms, suppressing any exceptions. try { Thread.sleep(sleeptime); } catch (InterruptedException ie) { |