|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.croftsoft.core.util.loop.WindowedLoopGovernor
public final class WindowedLoopGovernor
Uses windowed averaging to estimate the target loop delay. The window size starts off small to grows to some maximum size. Any pause greater than one second will cause a window size reset.
Constructor Summary | |
---|---|
WindowedLoopGovernor(double frequency)
Convenience constructor. |
|
WindowedLoopGovernor(long periodNanos,
int maxWindowSize,
long resetTimeNanos)
Main constructor. |
Method Summary | |
---|---|
void |
govern()
This method puts the Thread to sleep for a limited time. |
static void |
main(String[] args)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WindowedLoopGovernor(long periodNanos, int maxWindowSize, long resetTimeNanos)
public WindowedLoopGovernor(double frequency)
frequency
- The targeted loop frequency in loops per second.Method Detail |
---|
public static void main(String[] args) throws Exception
Exception
public void govern() throws InterruptedException
LoopGovernor
govern
in interface LoopGovernor
InterruptedException
|
CroftSoft Javadoc | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |