Package net.minecraft.util.profiler
Class ProfilerSystem
java.lang.Object
net.minecraft.util.profiler.ProfilerSystem
- All Implemented Interfaces:
Profiler
,ReadableProfiler
public class ProfilerSystem extends Object implements ReadableProfiler
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
ProfilerSystem.LocatedInfo
-
Field Summary
Fields Modifier and Type Field Description private boolean
checkTimeout
private ProfilerSystem.LocatedInfo
currentInfo
private IntSupplier
endTickGetter
private String
location
private Map<String,ProfilerSystem.LocatedInfo>
locationInfos
private static Logger
LOGGER
private List<String>
path
private int
startTick
private long
startTime
private boolean
tickStarted
private LongSupplier
timeGetter
private LongList
timeList
private static long
TIMEOUT_NANOSECONDS
-
Constructor Summary
Constructors Constructor Description ProfilerSystem(LongSupplier timeGetter, IntSupplier tickGetter, boolean checkTimeout)
-
Method Summary
Modifier and Type Method Description void
endTick()
private ProfilerSystem.LocatedInfo
getCurrentInfo()
ProfileResult
getResult()
void
pop()
void
push(String location)
void
push(Supplier<String> locationGetter)
void
startTick()
void
swap(String location)
void
swap(Supplier<String> locationGetter)
void
visit(String marker)
Increment the visit count for a marker.void
visit(Supplier<String> markerGetter)
Increment the visit count for a marker.
-
Field Details
-
TIMEOUT_NANOSECONDS
private static final long TIMEOUT_NANOSECONDS -
LOGGER
-
path
-
timeList
-
locationInfos
-
endTickGetter
-
timeGetter
-
startTime
private final long startTime -
startTick
private final int startTick -
location
-
tickStarted
private boolean tickStarted -
currentInfo
-
checkTimeout
private final boolean checkTimeout
-
-
Constructor Details
-
ProfilerSystem
-
-
Method Details
-
startTick
public void startTick() -
endTick
public void endTick() -
push
-
push
-
pop
public void pop() -
swap
-
swap
-
getCurrentInfo
-
visit
Increment the visit count for a marker.This is useful to keep track of number of calls made to performance- wise expensive methods.
-
visit
Increment the visit count for a marker.This is useful to keep track of number of calls made to performance- wise expensive methods.
This method is preferred if getting the marker is costly; the supplier won't be called if the profiler is disabled.
-
getResult
- Specified by:
getResult
in interfaceReadableProfiler
-