Class CriticalProfiler

java.lang.Object
etithespirit.orimod.util.profiling.CriticalProfiler

public final class CriticalProfiler extends Object
A profiler for the Ori mod. It is very similar to MC's ActiveProfiler but has some slight differences. It is deprecated in favor of using MC's built in stuff.
  • Constructor Details

    • CriticalProfiler

      public CriticalProfiler(org.apache.logging.log4j.Logger log, LongSupplier nanoSupplier, long warnTimeNanos, long totalWarnTimeNanos)
      Parameters:
      log - The logger to use.
      nanoSupplier - A supplier that returns the current system time in nanoseconds.
      warnTimeNanos - The amount of time that any subroutine must remain under, lest a warning is posted.
      totalWarnTimeNanos - The amount of time that the entire profiling operation must remain under, lest a warning is posted.
  • Method Details

    • isLive

      public boolean isLive()
      Returns:
      Whether or not this profiler is profiling right now.
    • profileBegin

      public void profileBegin()
      Begins the profiling process.
    • profileEnd

      public void profileEnd()
      Ends the profiling process.
    • push

      public void push(String routine)
      Starts a new subroutine.
      Parameters:
      routine - The name of the routine.
    • pop

      public void pop()
      Jumps out of the current subroutine.
    • popPush

      public void popPush(String newRoutine)
      Jumps out of the current subroutine, then jumps into a new one.
      Parameters:
      newRoutine - The name of the new routine.