ContinuousProfiler .java

net.minecraft.util.profiling.ContinuousProfiler (class): members: getFiller, suppressWarnings, realTime, enable, disable, getResults, profiler, isEnabled.

net.minecraft.util.profilingclass39 linescommon1.0 KB

API Surface (5)

boolean isEnabled()
void disable()
void enable()
ProfilerFiller getFiller()
ProfileResults getResults()

Fields & Constants (4)

realTime
tickCount
suppressWarnings
profiler

Code Graph: Dependencies (3)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

ContinuousProfiler.java39 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.util.profiling;
2
3
import java.util.function.BooleanSupplier;
4
import java.util.function.IntSupplier;
5
import java.util.function.LongSupplier;
6
7
public class ContinuousProfiler {
8
	private final LongSupplier realTime;
9
	private final IntSupplier tickCount;
10
	private final BooleanSupplier suppressWarnings;
11
	private ProfileCollector profiler = InactiveProfiler.INSTANCE;
12
13
	public ContinuousProfiler(final LongSupplier realTime, final IntSupplier tickCount, final BooleanSupplier suppressWarnings) {
14
		this.realTime = realTime;
15
		this.tickCount = tickCount;
16
		this.suppressWarnings = suppressWarnings;
17
	}
18
19
	public boolean isEnabled() {
20
		return this.profiler != InactiveProfiler.INSTANCE;
21
	}
22
23
	public void disable() {
24
		this.profiler = InactiveProfiler.INSTANCE;
25
	}
26
27
	public void enable() {
28
		this.profiler = new ActiveProfiler(this.realTime, this.tickCount, this.suppressWarnings);
29
	}
30
31
	public ProfilerFiller getFiller() {
32
		return this.profiler;
33
	}
34
35
	public ProfileResults getResults() {
36
		return this.profiler.getResults();
37
	}
38
}
39

Decompiled Minecraft 26.3 source of ContinuousProfiler (net/minecraft/util/profiling/ContinuousProfiler.java) with Mojang official mappings, stored verbatim on the site.