Class FpsCounter

java.lang.Object
org.graphstream.ui.view.util.FpsCounter

public class FpsCounter
extends Object
A simple counter that allows to count the number of frames per second.
Author:
Antoine Dutot
  • Constructor Details

  • Method Details

    • getFramesPerSecond

      public double getFramesPerSecond()
      The number of frames per second according to the last measured frame (instantaneous measure).
      Returns:
      The estimated frame-per-second measure of the last frame.
    • getLastFrameTimeInSeconds

      public double getLastFrameTimeInSeconds()
      The duration in seconds of the last measured frame.
      Returns:
      The last frame time in seconds.
    • getAverageMeasureCount

      public int getAverageMeasureCount()
      The number of frames times used to compute the average frame-per-second and frame time. This number augments with the measures until a maximum, where it is reset to 0.
      Returns:
      The number of frames measure.
    • getAverageFramesPerSecond

      public double getAverageFramesPerSecond()
      The average frame-per-second measure.
      Returns:
      The average number of frames per second.
      See Also:
      getAverageMeasureCount()
    • getAverageFrameTimeInSeconds

      public double getAverageFrameTimeInSeconds()
      The average frame time.
      Returns:
      The time used by a frame in average.
    • resetAverages

      public void resetAverages()
    • beginFrame

      public void beginFrame()
      Start a frame measure.
    • endFrame

      public void endFrame()
      End a frame measure.