Package org.spongepowered.asm.util.perf
Class Profiler.Section
java.lang.Object
org.spongepowered.asm.util.perf.Profiler.Section
- Enclosing class:
- Profiler
public class Profiler.Section
extends java.lang.Object
Profiler section. Normal sections do nothing so that the profiler itself
consumes minimal resources when disabled.
-
Field Summary
Fields Modifier and Type Field Description protected booleaninvalidatedTrue if this section has been invalidated by a call to Profiler#clear -
Method Summary
Modifier and Type Method Description Profiler.Sectionend()Stop timing of this section and end it (pop from profiler stack)doublegetAverageTime()Get the average time in milliseconds of each time period recorded in the current slicejava.lang.StringgetBaseName()Get the base name for this section, for delegated sections this is the name of the parent section, minus the rootintgetCount()Get the number of total time periods recorded in the current slicejava.lang.StringgetInfo()Get the auxilliary info for this sectionjava.lang.StringgetName()Get the section namedoublegetSeconds()Get the current time in seconds in the current phaselonggetTime()Get the current time in milliseconds in the current phaselong[]getTimes()Get all available time slices including the current one in millisecondsdoublegetTotalAverageTime()Get the average time in milliseconds of each time period recorded in the all slicesintgetTotalCount()Get the number of total time periods recorded in the all slicesdoublegetTotalSeconds()Get the current time in seconds in all phaseslonggetTotalTime()Get the current time in milliseconds in all phasesbooleanisFine()Get whether this section is FINEbooleanisRoot()Get whether this is a root sectionProfiler.Sectionnext(java.lang.String name)Stop timing of this section and start a new section at the same levelvoidsetInfo(java.lang.String info)Set the auxilliary info for this sectionprotected Profiler.Sectionstop()Stop timing of this sectionjava.lang.StringtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
invalidated
protected boolean invalidatedTrue if this section has been invalidated by a call to Profiler#clear
-
-
Method Details
-
isRoot
public boolean isRoot()Get whether this is a root section -
isFine
public boolean isFine()Get whether this section is FINE -
getName
public java.lang.String getName()Get the section name -
getBaseName
public java.lang.String getBaseName()Get the base name for this section, for delegated sections this is the name of the parent section, minus the root -
setInfo
public void setInfo(java.lang.String info)Set the auxilliary info for this section- Parameters:
info- aux info
-
getInfo
public java.lang.String getInfo()Get the auxilliary info for this section -
stop
Stop timing of this section- Returns:
- fluent
-
end
Stop timing of this section and end it (pop from profiler stack)- Returns:
- fluent
-
next
Stop timing of this section and start a new section at the same level- Parameters:
name- name of the next section- Returns:
- new section
-
getTime
public long getTime()Get the current time in milliseconds in the current phase -
getTotalTime
public long getTotalTime()Get the current time in milliseconds in all phases -
getSeconds
public double getSeconds()Get the current time in seconds in the current phase -
getTotalSeconds
public double getTotalSeconds()Get the current time in seconds in all phases -
getTimes
public long[] getTimes()Get all available time slices including the current one in milliseconds -
getCount
public int getCount()Get the number of total time periods recorded in the current slice -
getTotalCount
public int getTotalCount()Get the number of total time periods recorded in the all slices -
getAverageTime
public double getAverageTime()Get the average time in milliseconds of each time period recorded in the current slice -
getTotalAverageTime
public double getTotalAverageTime()Get the average time in milliseconds of each time period recorded in the all slices -
toString
public final java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-