Class stl_FPS

java.lang.Object
java.lang.Thread
com.jackmeng.stl.stl_FPS
All Implemented Interfaces:
java.lang.Runnable

public class stl_FPS
extends java.lang.Thread
This class is useful to represent FPS Calling FPS.interrupt() represents a new Frame has been drawn.
Author:
Jack Meng
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Thread

    java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
  • Field Summary

    Fields
    Modifier and Type Field Description
    private double fps  
    private java.util.List<java.lang.Runnable> listeners  
    private double max  
    private double min  

    Fields inherited from class java.lang.Thread

    MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
  • Constructor Summary

    Constructors
    Constructor Description
    stl_FPS()  
  • Method Summary

    Modifier and Type Method Description
    void addUpdatePromise​(java.lang.Runnable... promises)  
    double getFPS()  
    double getMax()  
    double getMin()  
    private void notifyPromises()  
    void run()  

    Methods inherited from class java.lang.Thread

    activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • fps

      private double fps
    • min

      private double min
    • max

      private double max
    • listeners

      private final java.util.List<java.lang.Runnable> listeners
  • Constructor Details

    • stl_FPS

      public stl_FPS()
  • Method Details

    • addUpdatePromise

      public void addUpdatePromise​(java.lang.Runnable... promises)
    • notifyPromises

      private void notifyPromises()
    • run

      public void run()
      Specified by:
      run in interface java.lang.Runnable
      Overrides:
      run in class java.lang.Thread
    • getFPS

      public double getFPS()
    • getMin

      public double getMin()
    • getMax

      public double getMax()