public class TimerEvent
extends java.lang.Object
Note that this class can also be used as a base class, in case there is a need to attach extra information to a TimerEvent.
All access to this class is unsynchronized. This class must be used either as an immutable (no calls to update), or access must be restricted to a single thread (as in an iterator).
Modifier and Type | Class and Description |
---|---|
static class |
TimerEvent.TimerEventType |
Constructor and Description |
---|
TimerEvent(TimerEvent te) |
TimerEvent(Timer timer,
TimerEvent.TimerEventType etype)
Create a TimerEvent at the current time.
|
TimerEvent(Timer timer,
TimerEvent.TimerEventType etype,
long time)
Create a TimerEvent at the given time.
|
Modifier and Type | Method and Description |
---|---|
void |
incrementTime(long update) |
long |
time()
Time of event in nanoseconds since the TimerLog
was created or cleared.
|
Timer |
timer()
The name of the Timer used to create this entry.
|
java.lang.String |
toString() |
TimerEvent.TimerEventType |
type()
Type of event: ENTER for start of interval for a
Timer, EXIT for end of the interval.
|
void |
update(Timer timer,
TimerEvent.TimerEventType etype,
long time)
Re-use the same TimerEvent instance with different
data.
|
public TimerEvent(TimerEvent te)
public TimerEvent(Timer timer, TimerEvent.TimerEventType etype)
public TimerEvent(Timer timer, TimerEvent.TimerEventType etype, long time)
public java.lang.String toString()
toString
in class java.lang.Object
public void update(Timer timer, TimerEvent.TimerEventType etype, long time)
public void incrementTime(long update)
public Timer timer()
public TimerEvent.TimerEventType type()
public long time()