|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gicentre.utils.FrameTimer
public class FrameTimer
Class for displaying frame rates in a sketch. To use, declare a FrameTimer
object at the top of a sketch, initialise it in the setup()
method, and
call displayFrameRate()
in the draw()
method.
Constructor Summary | |
---|---|
FrameTimer()
Creates a timer that will report the frame rate once in every 50 frames. |
|
FrameTimer(int reportRate)
Creates a timer that will report the frame rate once in every reportRate
frames. |
Method Summary | |
---|---|
void |
displayFrameRate()
Displays the current frame rate. |
float |
getElapsedTime()
Retrieves the time since the last call to startTimer() |
void |
startTimer()
Starts a timer that can be used for timing specific parts of a programming. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FrameTimer()
public FrameTimer(int reportRate)
reportRate
frames.
reportRate
- Number of frames to elapse before reporting current frame rate.Method Detail |
---|
public void displayFrameRate()
reportRate
frames.
public void startTimer()
getElapsedTime
to retrieve the number of seconds since a call was made
to this method.
public float getElapsedTime()
startTimer()
startTimer
was last called, or 0 if it has not been called.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |