T
- public class TimeTracker<T>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.lang.ref.WeakReference<T> |
currentlyTracking |
private boolean |
enabled |
static TimeTracker<Entity> |
ENTITY_UPDATE
A tracker for timing entity updates
|
static TimeTracker<TileEntity> |
TILE_ENTITY_UPDATE
A tracker for timing tile entity update
|
private long |
timing |
private java.util.Map<T,int[]> |
timings |
private int |
trackingDuration |
private long |
trackTime |
Constructor and Description |
---|
TimeTracker() |
Modifier and Type | Method and Description |
---|---|
void |
enable(int duration)
Starts recording tracking data for the given duration in seconds
|
com.google.common.collect.ImmutableList<ForgeTimings<T>> |
getTimingData()
Returns the timings data recorded by the tracker
|
void |
reset()
Resets the tracker (clears timings and stops any in-progress timings)
|
void |
trackEnd(T tracking)
Ends the timing of the currently tracking object
|
private void |
trackEnd(T object,
long nanoTime) |
void |
trackStart(T toTrack)
Starts timing of the provided object
|
private void |
trackStart(T toTrack,
long nanoTime) |
public static final TimeTracker<TileEntity> TILE_ENTITY_UPDATE
public static final TimeTracker<Entity> ENTITY_UPDATE
private boolean enabled
private int trackingDuration
private java.util.Map<T,int[]> timings
private java.lang.ref.WeakReference<T> currentlyTracking
private long trackTime
private long timing
public com.google.common.collect.ImmutableList<ForgeTimings<T>> getTimingData()
public void reset()
public void trackEnd(T tracking)
tracking
- The object to stop timingpublic void enable(int duration)
duration
- The duration for the time to trackpublic void trackStart(T toTrack)
toTrack
- The object to start timingprivate void trackEnd(T object, long nanoTime)
private void trackStart(T toTrack, long nanoTime)