public final class Profiler
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
java.lang.String |
name
Name of this profiler
|
| Constructor and Description |
|---|
Profiler(java.lang.String name)
Creates new profiler.
|
| Modifier and Type | Method and Description |
|---|---|
double |
average()
Calculates average time between cycles.
|
Profiler |
clearResults()
Clears saved results for average computations.
|
double |
elapsed()
Measures time since last (lap)start of this profiler.
|
double |
end()
Ends current profiling session.
|
boolean |
isRunning()
States whether profiler is currently performing time measurements.
|
double |
lap()
Helper method for loop time measurements.
|
double |
lastTime()
Getter for last cycle time.
|
java.util.List<java.lang.Double> |
results()
Getter for lap timing.
|
Profiler |
start()
Starts this profiler.
|
java.lang.String |
toString() |
public Profiler(java.lang.String name)
name - of this profiler.public Profiler start()
this for chaining.java.lang.IllegalStateException - if profiler is currently running. See isRunning()public double end()
java.lang.IllegalStateException - if profiler is not currently running. See isRunning()public double lap()
java.lang.IllegalStateException - if profiler is not currently running. See isRunning()public boolean isRunning()
true if profiler is running.public double elapsed()
java.lang.IllegalStateException - if profiler is not currently running. See isRunning()public double lastTime()
public double average()
public java.util.List<java.lang.Double> results()
public Profiler clearResults()
public java.lang.String toString()
toString in class java.lang.Object