|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.michab.simulator.Clock
The central clock management for an emulation. Represents a clock with configurable resolution. The clock is the synchronisation point for the emulation time and is also responsible to keep in sync with real time, that is, if the emulation is faster than real time, the clock throttles the emulation by performing intermediate sleep cycles.
Actual communication from the clock and clock clients is
performed through an instance of Clock.ClockHandle
created by
a call to register()
.
Nested Class Summary | |
class |
Clock.ClockHandle
Each clock client receives a ClockHandle as the result
of performing the register() operation. |
Constructor Summary | |
Clock(long ticksPerSecond)
Creates a clock with the specified frequency. |
Method Summary | |
long |
currentTime()
Get the clock's current time. |
long |
getResolution()
Get the clock's resolution in ticks per second. |
Clock.ClockHandle |
register()
Registers a client with this clock. |
void |
start()
Starts dispatching. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Clock(long ticksPerSecond)
ticksPerSecond
- This clock's frequency.Method Detail |
public void start()
prepare()
before thread scheduling is
started.
public Clock.ClockHandle register()
java.lang.IllegalStateException
- When the clock has been started yet.start()
public long currentTime()
public long getResolution()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |