gameframe.util
Interface Timer
- public interface Timer
Interface for a generic timer class that times the (average or exact, depending
on implementation) time between the calls made to the calculateTime() method.
Useful for e.g. finding out how long a main game loop takes and adjusting the game
timing accordingly. The maximum time that a timer class must be able to calculate
is 10000 milliseconds = 10 seconds, this should suffice for all purposes where
exact timing is required. In other cases, use the java.lang.System.currentTimeMillis()
method directly in your application.
- Since:
- GameFrame for Java 0.9
- Version:
- GameFrame for Java 0.9.4
- Author:
- Pasi Keränen 16. May 1999
- See Also:
GameFrame
Method Summary |
float |
calculateTime()
When invoked calculates and returns the time that has elapsed since the last
invokation in milliseconds (actual resolutin may vary from implementation to
implementation). |
void |
finalize()
Frees all the resources that are used by the timer. |
calculateTime
public float calculateTime()
- When invoked calculates and returns the time that has elapsed since the last
invokation in milliseconds (actual resolutin may vary from implementation to
implementation).
- Returns:
- The time that has elapsed since last invokation.
- Since:
- GameFrame for Java 0.9
finalize
public void finalize()
- Frees all the resources that are used by the timer.
- Since:
- GameFrame for Java 0.9.2