mako5.evnt
Class TimeGnome

java.lang.Object
  extended by mako5.evnt.TimeGnome

public class TimeGnome
extends Object

The time keeper that knows the number of elapsed milliseconds, the number of frames, and can calculate the time per frame. Keeps a running mSPF (milliseconds/frame) count and can be used as a timer function for smoothing of programs.

Since:
03-Apr 2006
Version:
03-Apr 2006, 20-Apr 2006, 17-May 2006, 02-Jul 2006, 07-Jul 2006
Author:
Paul Jarrett

Constructor Summary
TimeGnome()
          Initializes values for all variables.
TimeGnome(long resetFrames)
          Initializes values for all variables.
 
Method Summary
 float getMSPF()
          Returns the number of milliseconds per frame.
 void reset()
          Provides a starting time for the gnome and resets the number of frames.
 void update()
          Recalcs elapsed time and increments the number of frames.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeGnome

public TimeGnome()
Initializes values for all variables.

Since:
03-Apr 2006, 07-Jul 2006

TimeGnome

public TimeGnome(long resetFrames)
Initializes values for all variables.

Since:
03-Apr 2006, 07-Jul 2006
Method Detail

reset

public void reset()
Provides a starting time for the gnome and resets the number of frames. This in turn lets the program determine when to start counting frames, and elapsed time.

Since:
03-Apr 2006 (known as setup(void)), 17-May 2006 (known as setup(void)), 07-Jul 2006

update

public void update()
Recalcs elapsed time and increments the number of frames.

Since:
03-Apr 2006

getMSPF

public float getMSPF()
Returns the number of milliseconds per frame.

Returns:
the number of milliseconds per frame
Since:
03-Apr 2006