Android Utililty Methods Thread Sleep

List of utility methods to do Thread Sleep

Description

The list of methods to do Thread Sleep are organized into topic(s).

Method

voidsleep(long ms)
sleep
try {
    Thread.sleep(ms);
} catch (InterruptedException e) {
booleansleep(long ms)
sleep
try {
    if (ms > 0) {
        Thread.sleep(ms);
    return true;
} catch (InterruptedException e) {
    return false;
voidsafeSleep(long millis)
safe Sleep
try {
    Thread.sleep(millis);
} catch (InterruptedException e) {
voidsleep(long milliseconds)
Waits n milliseconds.
try {
    Thread.sleep(milliseconds);
} catch (InterruptedException e) {
    Log.e(LOG_TAG, "Unable to sleep " + milliseconds, e);
voiddoSleep(long ms)
do Sleep
try {
    Thread.sleep(ms);
} catch (InterruptedException ie) {
voidsleep(double numSeconds)
Cause the current thread to sleep for numSeconds.
assert numSeconds >= 0.0 : "numSeconds must be >= 0.0";
try {
    Thread.sleep((int) (numSeconds * 1000.0));
} catch (InterruptedException e) {