|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.monad.homerun.util.HRTimer
public class HRTimer
HRTimer is a simple system-wide timer facility using a singleton Timer, with additional instrumentation.
| Method Summary | |
|---|---|
void |
addDelayedTask(java.util.TimerTask task,
long delay,
long period)
Adds a repeating task with an initial delay |
void |
addOneOffTask(java.util.TimerTask task,
long delay)
Adds a task to be executed only once |
void |
addTask(java.util.TimerTask task,
long period)
Adds a repeating task to the timer |
void |
cancelTask(java.util.TimerTask task)
Cancels a regsitered task |
static HRTimer |
getInstance()
Resturns an instance of an HRTimer |
int |
getNumOneOffTasks()
Returns the current number of non-repeatable tasks |
int |
getNumRepeatTasks()
Returns the current number of repeatable tasks |
int |
getNumTasks()
Returns the number of active tasks |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static HRTimer getInstance()
public void addTask(java.util.TimerTask task,
long period)
task - the timer task to addperiod - the time interval between task executions
public void addOneOffTask(java.util.TimerTask task,
long delay)
task - the task to performdelay - initial time interval before execution
public void addDelayedTask(java.util.TimerTask task,
long delay,
long period)
task - the task to adddelay - the intial delay before first executionperiod - the interval between task executionspublic void cancelTask(java.util.TimerTask task)
task - the task to be cancelledpublic int getNumTasks()
public int getNumRepeatTasks()
public int getNumOneOffTasks()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||