List of utility methods to do Sleep
void | sleep(long millis) The function causes the currently executing thread to sleep. try { Thread.sleep(millis); } catch (InterruptedException e) { Thread.currentThread().interrupt(); |
void | sleep(long millis) sleep try { Thread.sleep(millis); } catch (InterruptedException ex) { return; |
void | sleep(long millis) sleep if (millis < 0) { throw new IllegalArgumentException(); long start = System.currentTimeMillis(); long elapsed = 0; do { try { Thread.sleep(millis - elapsed); ... |
void | sleep(long millis) Puts the current thread to sleep for the specificed number of milliseconds. try { Thread.sleep(millis); } catch (Exception e) { e.printStackTrace(); |
void | sleep(long millis) sleep try { Thread.sleep(millis); } catch (InterruptedException ex) { throw new RuntimeException(ex); |
void | sleep(long millis) Sleeps the specified number of milliseconds. long started = System.currentTimeMillis(); long waited = 0; while (waited < millis) { try { Thread.sleep(millis - waited); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); waited = System.currentTimeMillis() - started; |
void | sleep(long millis) sleep long now = System.currentTimeMillis(); long remaining = millis - (System.currentTimeMillis() - now); while (remaining > 0) { try { Thread.sleep(remaining, 0); } catch (InterruptedException e) { remaining = millis - (System.currentTimeMillis() - now); ... |
boolean | sleep(long milliseconds) Puts the current thread to sleep for the specified number of milliseconds. boolean interrupted = Thread.interrupted(); if (!interrupted) { try { Thread.sleep(milliseconds); } catch (InterruptedException ex) { interrupted = true; Thread.interrupted(); return !interrupted; |
void | Sleep(long milliseconds) Causes the current thread to sleep for a certain length of time. Thread.currentThread().sleep(milliseconds); |
void | sleep(long milliTime) This method puts the current thread to sleep for the given time in msec. long wakeupTime = System.currentTimeMillis() + milliTime; while (milliTime > 0) { try { Thread.sleep(milliTime); break; } catch (InterruptedException e) { milliTime = wakeupTime - System.currentTimeMillis(); |