com.croftsoft.core.util.loop
Class FixedDelayLoopGovernor
java.lang.Object
com.croftsoft.core.util.loop.FixedDelayLoopGovernor
- All Implemented Interfaces:
- LoopGovernor
public final class FixedDelayLoopGovernor
- extends Object
- implements LoopGovernor
Maintains a periodic rate by stalling the loop by a fixed delay.
- Since:
- 2002-03-07
- Version:
- 2003-05-22
- Author:
- David Wallace Croft
Method Summary |
void |
govern()
Stalls the current Thread by the fixed delay period. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FixedDelayLoopGovernor
public FixedDelayLoopGovernor(long delayMillis,
int delayNanos)
FixedDelayLoopGovernor
public FixedDelayLoopGovernor(double frequency)
- Constructs a LoopGovernor with the specified target frequency.
- Parameters:
frequency
- The targeted loop frequency in loops per second.
govern
public void govern()
throws InterruptedException
- Stalls the current Thread by the fixed delay period.
- Specified by:
govern
in interface LoopGovernor
- Throws:
InterruptedException
CroftSoft Core Javadoc (2008-09-28 20:58:02)