@InterfaceAudience.Private public class Sleeper extends Object
Modifier and Type | Method and Description |
---|---|
int |
getPeriod() |
void |
skipSleepCycle()
If currently asleep, stops sleeping; if not asleep, will skip the next
sleep cycle.
|
void |
sleep()
Sleep for period.
|
void |
sleep(long startTime)
Sleep for period adjusted by passed
startTime |
public Sleeper(int sleep, Stoppable stopper)
sleep
- sleep time in millisecondsstopper
- When Stoppable.isStopped()
is true, this thread will
cleanup and exit cleanly.public void sleep()
public void skipSleepCycle()
public void sleep(long startTime)
startTime
startTime
- Time some task started previous to now. Time to sleep
will be docked current time minus passed startTime
.public final int getPeriod()
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.