start() just before
starting the task and stop() right after. You can do this multiple times if required. Every render or update call
tick() to update the values. The time FloatCounter provides access to the minimum, maximum, average,
total and current time (in seconds) the task takes. Likewise for the load value, which is the percentage of the total
time.
| Modifier and Type | Field and Description |
|---|---|
| public float | |
| private long | |
| public final FloatCounter | load
The load value of this counter |
| public final String | name
The name of this counter |
| private static final float | |
| private long | |
| public final FloatCounter | time
The time value of this counter (seconds) |
| public boolean | valid
Flag to indicate that the current value is valid, you need to set this to true if using your own timing mechanism |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void | |
| public void | |
| public void | tick(final float
The time since the last call to this method delta)Updates the time and load counters and resets the time. |
| public String | |
| public StringBuilder |
| current | back to summary |
|---|---|
| public float current The current value in seconds, you can manually increase this using your own timing mechanism if needed, if you do so, you
also need to update | |
| lastTick | back to summary |
|---|---|
| private long lastTick | |
| load | back to summary |
|---|---|
| public final FloatCounter load The load value of this counter | |
| name | back to summary |
|---|---|
| public final String name The name of this counter | |
| nano2seconds | back to summary |
|---|---|
| private static final float nano2seconds | |
| startTime | back to summary |
|---|---|
| private long startTime | |
| time | back to summary |
|---|---|
| public final FloatCounter time The time value of this counter (seconds) | |
| valid | back to summary |
|---|---|
| public boolean valid Flag to indicate that the current value is valid, you need to set this to true if using your own timing mechanism | |
| PerformanceCounter | back to summary |
|---|---|
| public PerformanceCounter(final String name) | |
| PerformanceCounter | back to summary |
|---|---|
| public PerformanceCounter(final String name, final int windowSize) | |
| reset | back to summary |
|---|---|
| public void reset() Resets this performance counter to its defaults values. | |
| start | back to summary |
|---|---|
| public void start() Start counting, call this method just before performing the task you want to keep track of. Call | |
| stop | back to summary |
|---|---|
| public void stop() Stop counting, call this method right after you performed the task you want to keep track of. Call | |
| tick | back to summary |
|---|---|
| public void tick() Updates the time and load counters and resets the time. Call | |
| tick | back to summary |
|---|---|
| public void tick(final float delta) Updates the time and load counters and resets the time. Call
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| toString | back to summary |
|---|---|
| public StringBuilder toString(final StringBuilder sb) Creates a string in the form of "name [time: value, load: value]" | |