Class PerformanceAppState

java.lang.Object
com.jme3.app.state.AbstractAppState
jme3utilities.NamedAppState
jme3utilities.SimpleAppState
jme3utilities.debug.PerformanceAppState
All Implemented Interfaces:
com.jme3.app.state.AppState

public class PerformanceAppState extends SimpleAppState
App state that implements a latency-oriented performance monitor for jMonkeyEngine3. It displays the duration of the longest update during the preceding measurement interval.

Each instance is enabled at creation.

  • Constructor Details

    • PerformanceAppState

      public PerformanceAppState()
      Instantiate a new enabled, uninitialized state.
  • Method Details

    • setUpdateInterval

      public void setUpdateInterval(float newInterval)
      Alter the measurement interval.
      Parameters:
      newInterval - (in seconds, >0)
    • updateInterval

      public float updateInterval()
      Read the measurement interval.
      Returns:
      interval (in seconds, >0)
    • cleanup

      public void cleanup()
      Clean up this performance monitor after it has been detached. Should be invoked only by a subclass or by the AppStateManager.
      Specified by:
      cleanup in interface com.jme3.app.state.AppState
      Overrides:
      cleanup in class NamedAppState
    • initialize

      public void initialize(com.jme3.app.state.AppStateManager stateManager, com.jme3.app.Application application)
      Initialize this performance monitor prior to its first update. Should be invoked only by a subclass or by the AppStateManager.
      Specified by:
      initialize in interface com.jme3.app.state.AppState
      Overrides:
      initialize in class SimpleAppState
      Parameters:
      stateManager - the manager for this state (not null)
      application - (not null)
    • setEnabled

      public void setEnabled(boolean newSetting)
      Enable or disable this performance monitor.
      Specified by:
      setEnabled in interface com.jme3.app.state.AppState
      Overrides:
      setEnabled in class NamedAppState
      Parameters:
      newSetting - true → enable, false → disable
    • update

      public void update(float timePerFrame)
      Update the performance statistics.
      Specified by:
      update in interface com.jme3.app.state.AppState
      Overrides:
      update in class NamedAppState
      Parameters:
      timePerFrame - time interval between updates (in seconds, ≥0)