ContinuousProfiler.java

net.minecraft.util.profiling.ContinuousProfiler

信息

  • 全限定名:net.minecraft.util.profiling.ContinuousProfiler
  • 类型:public class
  • 包:net.minecraft.util.profiling
  • 源码路径:src/main/java/net/minecraft/util/profiling/ContinuousProfiler.java
  • 起始行号:L7
  • 职责:

    TODO

字段/常量

  • realTime

    • 类型: LongSupplier
    • 修饰符: private final
    • 源码定位: L8
    • 说明:

      TODO

  • tickCount

    • 类型: IntSupplier
    • 修饰符: private final
    • 源码定位: L9
    • 说明:

      TODO

  • suppressWarnings

    • 类型: BooleanSupplier
    • 修饰符: private final
    • 源码定位: L10
    • 说明:

      TODO

  • profiler

    • 类型: ProfileCollector
    • 修饰符: private
    • 源码定位: L11
    • 说明:

      TODO

内部类/嵌套类型

构造器

public ContinuousProfiler(LongSupplier realTime, IntSupplier tickCount, BooleanSupplier suppressWarnings) @ L13

  • 构造器名:ContinuousProfiler
  • 源码定位:L13
  • 修饰符:public

参数:

  • realTime: LongSupplier
  • tickCount: IntSupplier
  • suppressWarnings: BooleanSupplier

说明:

TODO

方法

下面的方法块按源码顺序生成。

public boolean isEnabled() @ L19

  • 方法名:isEnabled
  • 源码定位:L19
  • 返回类型:boolean
  • 修饰符:public

参数:

说明:

TODO

public void disable() @ L23

  • 方法名:disable
  • 源码定位:L23
  • 返回类型:void
  • 修饰符:public

参数:

说明:

TODO

public void enable() @ L27

  • 方法名:enable
  • 源码定位:L27
  • 返回类型:void
  • 修饰符:public

参数:

说明:

TODO

public ProfilerFiller getFiller() @ L31

  • 方法名:getFiller
  • 源码定位:L31
  • 返回类型:ProfilerFiller
  • 修饰符:public

参数:

说明:

TODO

public ProfileResults getResults() @ L35

  • 方法名:getResults
  • 源码定位:L35
  • 返回类型:ProfileResults
  • 修饰符:public

参数:

说明:

TODO

代码

public class ContinuousProfiler {
    private final LongSupplier realTime;
    private final IntSupplier tickCount;
    private final BooleanSupplier suppressWarnings;
    private ProfileCollector profiler = InactiveProfiler.INSTANCE;
 
    public ContinuousProfiler(LongSupplier realTime, IntSupplier tickCount, BooleanSupplier suppressWarnings) {
        this.realTime = realTime;
        this.tickCount = tickCount;
        this.suppressWarnings = suppressWarnings;
    }
 
    public boolean isEnabled() {
        return this.profiler != InactiveProfiler.INSTANCE;
    }
 
    public void disable() {
        this.profiler = InactiveProfiler.INSTANCE;
    }
 
    public void enable() {
        this.profiler = new ActiveProfiler(this.realTime, this.tickCount, this.suppressWarnings);
    }
 
    public ProfilerFiller getFiller() {
        return this.profiler;
    }
 
    public ProfileResults getResults() {
        return this.profiler.getResults();
    }
}

引用的其他类