com.golden.gamedev.engine.timer
Class SystemTimer3

java.lang.Object
  |
  +--com.golden.gamedev.engine.timer.SystemTimer3
All Implemented Interfaces:
BaseTimer

public class SystemTimer3
extends Object
implements BaseTimer

Experimental timer.


Constructor Summary
SystemTimer3()
           
 
Method Summary
 int getCurrentFPS()
          Returns current frame per second.
 int getCurrentUPS()
           
 int getRequestedFPS()
          Returns requested frame per second.
 boolean isNeedMoreUpdate()
           
 boolean isRunning()
          Returns true if the timer is currently running (startTimer(int) has been called).
 void sleep()
           
 void startTimer(int fps)
          Starts the timer with fps frame per second.
 void stopTimer()
          Stops the timer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemTimer3

public SystemTimer3()
Method Detail

startTimer

public void startTimer(int fps)
Description copied from interface: BaseTimer
Starts the timer with fps frame per second.

Specified by:
startTimer in interface BaseTimer
Parameters:
fps - the timer frame per second.
See Also:
BaseTimer.getCurrentFPS(), BaseTimer.getRequestedFPS()

stopTimer

public void stopTimer()
Description copied from interface: BaseTimer
Stops the timer.

Specified by:
stopTimer in interface BaseTimer

sleep

public void sleep()
Specified by:
sleep in interface BaseTimer

isRunning

public boolean isRunning()
Description copied from interface: BaseTimer
Returns true if the timer is currently running (BaseTimer.startTimer(int) has been called).

Specified by:
isRunning in interface BaseTimer

isNeedMoreUpdate

public boolean isNeedMoreUpdate()

getCurrentUPS

public int getCurrentUPS()

getCurrentFPS

public int getCurrentFPS()
Description copied from interface: BaseTimer
Returns current frame per second.
Current frame per second is the actual fps the user machine could achieved.
This may differ from the requested frame per second because of the incapability of the user processor.

Specified by:
getCurrentFPS in interface BaseTimer
Returns:
current frame per second
See Also:
BaseTimer.getRequestedFPS()

getRequestedFPS

public int getRequestedFPS()
Description copied from interface: BaseTimer
Returns requested frame per second.
Requested frame per second is the requested fps by calling startTimer(int) method.
Because of the incapability of the user processor, high requested fps may not always be achieved.
To get the actual fps achieved see getCurrentFPS().

Specified by:
getRequestedFPS in interface BaseTimer
Returns:
requested frame per second
See Also:
BaseTimer.getCurrentFPS(), BaseTimer.startTimer(int)