public class SleepWakeup extends Object
| Constructor and Description |
|---|
SleepWakeup() |
| Modifier and Type | Method and Description |
|---|---|
void |
sleep()
Blocks the calling thread until another thread calls this object's
wakeup() or a certain timeout passes. |
static void |
sleep(int ms)
Sleeps for the provided amount of milliseconds, ignoring thread
interrupts.
|
void |
wakeup()
Wakes up all sleeping threads currently in
sleep(). |
public void wakeup()
sleep().public void sleep()
wakeup() or a certain timeout passes. This method can be used in
a loop or similar environment to avoid CPU over-utilization.public static void sleep(int ms)
ms - how many milliseconds to sleepCopyright © 2015. All rights reserved.