public class FpsCounter extends Object
Modifier and Type | Field and Description |
---|---|
protected double |
avgTime
The average time.
|
protected int |
count
Counter for the average.
|
protected double |
t1
Time measure.
|
protected double |
t2
Time measure.
|
protected double |
time
The last frame time.
|
Constructor and Description |
---|
FpsCounter() |
Modifier and Type | Method and Description |
---|---|
void |
beginFrame()
Start a frame measure.
|
void |
endFrame()
End a frame measure.
|
double |
getAverageFramesPerSecond()
The average frame-per-second measure.
|
double |
getAverageFrameTimeInSeconds()
The average frame time.
|
int |
getAverageMeasureCount()
The number of frames times used to compute the average frame-per-second
and frame time.
|
double |
getFramesPerSecond()
The number of frames per second according to the last measured frame
(instantaneous measure).
|
double |
getLastFrameTimeInSeconds()
The duration in seconds of the last measured frame.
|
void |
resetAverages() |
protected double t1
protected double t2
protected double time
protected int count
protected double avgTime
public FpsCounter()
public double getFramesPerSecond()
public double getLastFrameTimeInSeconds()
public int getAverageMeasureCount()
public double getAverageFramesPerSecond()
getAverageMeasureCount()
public double getAverageFrameTimeInSeconds()
public void resetAverages()
public void beginFrame()
public void endFrame()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses