@InterfaceAudience.Private public class Sleeper extends Object
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–2018 The Apache Software Foundation. All rights reserved.