Class Timer

java.lang.Object
  extended byTimer

public class Timer
extends java.lang.Object

An object in this class acts as a timer, indicating both how much time has elapsed from the time the object was created, as well as how much time remains until the end of a specified period.


Constructor Summary
Timer(long max_time)
          This constructor begins a timer which will run for a period specified by the max_time parameter.
 
Method Summary
 long getTimeElapsed()
          Returns the time (in milliseconds) that has elapsed since the creation of this object.
 long getTimeRemaining()
          Returns the time (in milliseconds) that remains until the timer object reaches the end of the period specified at its creation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Timer

public Timer(long max_time)
This constructor begins a timer which will run for a period specified by the max_time parameter.

Parameters:
max_time - timer duration in milliseconds
Method Detail

getTimeElapsed

public long getTimeElapsed()
Returns the time (in milliseconds) that has elapsed since the creation of this object.


getTimeRemaining

public long getTimeRemaining()
Returns the time (in milliseconds) that remains until the timer object reaches the end of the period specified at its creation.