Package org.spongepowered.asm.util.perf
Class Profiler.Section
java.lang.Object
org.spongepowered.asm.util.perf.Profiler.Section
- Enclosing class:
- Profiler
Base abstract profiler section. When disabled, the profiler itself
returns
Profiler.DisabledSection
so as to consume minimal resources
without needing to introduce nullability checks everwhere that sections
are used. When enabled, Profiler.LiveSection
is used to record timings.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
True if this section has been invalidated by a call to Profiler#clear -
Method Summary
Modifier and TypeMethodDescriptionend()
Stop timing of this section and end it (pop from profiler stack)double
Get the average time in milliseconds of each time period recorded in the current sliceGet the base name for this section, for delegated sections this is the name of the parent section, minus the rootint
getCount()
Get the number of total time periods recorded in the current sliceprotected int
getInfo()
Get the auxilliary info for this sectionprotected int
Internal accessor for markedCount from LiveSection, used by ResultSectionprotected long
Internal accessor for markedTime from LiveSection, used by ResultSectiongetName()
Get the section namedouble
Get the current time in seconds in the current phaselong
getTime()
Get the current time in milliseconds in the current phaselong[]
getTimes()
Get all available time slices including the current one in millisecondsdouble
Get the average time in milliseconds of each time period recorded in the all slicesint
Get the number of total time periods recorded in the all slicesdouble
Get the current time in seconds in all phaseslong
Get the current time in milliseconds in all phasesboolean
isFine()
Get whether this section is FINEboolean
isRoot()
Get whether this is a root sectionStop timing of this section and start a new section at the same levelvoid
Set the auxilliary info for this sectionprotected Profiler.Section
stop()
Stop timing of this sectionfinal String
toString()
-
Field Details
-
invalidated
protected boolean invalidatedTrue if this section has been invalidated by a call to Profiler#clear
-
-
Method Details
-
getCursor
protected int getCursor() -
isRoot
public boolean isRoot()Get whether this is a root section -
isFine
public boolean isFine()Get whether this section is FINE -
getName
Get the section name -
getBaseName
Get the base name for this section, for delegated sections this is the name of the parent section, minus the root -
setInfo
Set the auxilliary info for this section- Parameters:
info
- aux info
-
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
-
getMarkedTime
protected long getMarkedTime()Internal accessor for markedTime from LiveSection, used by ResultSection -
getMarkedCount
protected int getMarkedCount()Internal accessor for markedCount from LiveSection, used by ResultSection
-