- java.lang.Object
-
- swim.concurrent.Clock
-
- swim.concurrent.StageClock
-
-
Field Summary
Fields Modifier and Type Field Description protected Stage
stage
Stage
on which to execute timer functions.-
Fields inherited from class swim.concurrent.Clock
TICK_COUNT, TICK_MILLIS
-
-
Constructor Summary
Constructors Constructor Description StageClock(Stage stage)
Constructs a newStageClock
with a timer resolution ofClock.TICK_MILLIS
milliseconds, and a clock period ofClock.TICK_COUNT
ticks per revolution, that executes timer functions on the givenstage
.StageClock(Stage stage, int tickMillis, int tickCount)
Constructs a newStageClock
with a timer resolution oftickMillis
milliseconds, and a clock period oftickCount
ticks per revolution, that executes timer functions on the givenstage
.StageClock(Stage stage, ClockDef clockDef)
Constructs a newStageClock
, with the timer resolution and clock period specified by the givenclockDef
, that executes timer functions on the givenstage
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
runTimer(TimerFunction timer, Runnable runnable)
Stage
stage()
Returns the stage on which to execute timer functions.-
Methods inherited from class swim.concurrent.Clock
didFail, didStart, didStop, didTick, nanoTime, setTimer, sleep, start, stop, tick, timer, timerDidCancel, timerDidFail, timerDidRun, timerWillRun, timerWillSchedule, willStart, willStop
-
-
-
-
Field Detail
-
stage
protected final Stage stage
Stage
on which to execute timer functions.
-
-
Constructor Detail
-
StageClock
public StageClock(Stage stage, int tickMillis, int tickCount)
Constructs a newStageClock
with a timer resolution oftickMillis
milliseconds, and a clock period oftickCount
ticks per revolution, that executes timer functions on the givenstage
.
-
StageClock
public StageClock(Stage stage, ClockDef clockDef)
Constructs a newStageClock
, with the timer resolution and clock period specified by the givenclockDef
, that executes timer functions on the givenstage
.
-
StageClock
public StageClock(Stage stage)
Constructs a newStageClock
with a timer resolution ofClock.TICK_MILLIS
milliseconds, and a clock period ofClock.TICK_COUNT
ticks per revolution, that executes timer functions on the givenstage
.
-
-
Method Detail
-
stage
public final Stage stage()
Returns the stage on which to execute timer functions.
-
runTimer
protected void runTimer(TimerFunction timer, Runnable runnable)
-
-