Package com.jackmeng.stl
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 doublefpsprivate java.util.List<java.lang.Runnable>listenersprivate doublemaxprivate doubleminFields 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 voidaddUpdatePromise(java.lang.Runnable... promises)doublegetFPS()doublegetMax()doublegetMin()private voidnotifyPromises()voidrun()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, yieldMethods 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:
runin interfacejava.lang.Runnable- Overrides:
runin classjava.lang.Thread
-
getFPS
public double getFPS() -
getMin
public double getMin() -
getMax
public double getMax()
-