jclass
Class Timer

java.lang.Object
  |
  +--jclass.TimedObject
        |
        +--jclass.Timer

public class Timer
extends TimedObject

A simple timer in ms.

Written: Radu Sion
Version: 0.14
Source: Timer.java

Visit Smart Software 

See Also:
Serialized Form

Fields inherited from class jclass.TimedObject
Created
 
Constructor Summary
Timer()
          Constructs a new started timer object, initialized with the current UTC time in ms.
Timer(long init_offset)
          Constructs a new stopped timer object, resetting it to the parameter specified value.
 
Method Summary
 void addTime(long offset)
          Adds the given amount of ms to this timer.
 void reset(long init_offset)
          Resets the timer to the specified value and stops it
 void setTime(long offset)
          Sets the timer to the specified value and leaves it in it's current state.
 void start()
          Starts the timer.
 void stop()
          Stops the timer.
 long time()
          Gets the Timer indication.
 
Methods inherited from class jclass.TimedObject
computeAge, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

A NAME="constructor_detail">

Constructor Detail

Timer

public Timer(long init_offset)
Constructs a new stopped timer object, resetting it to the parameter specified value.

Timer

public Timer()
Constructs a new started timer object, initialized with the current UTC time in ms. This timer should be used only as some wrapping for the System.getcurrentTimeMillis() call and should NOT be stopped.
Method Detail

addTime

public void addTime(long offset)
Adds the given amount of ms to this timer.

reset

public void reset(long init_offset)
Resets the timer to the specified value and stops it

setTime

public void setTime(long offset)
Sets the timer to the specified value and leaves it in it's current state.

stop

public void stop()
Stops the timer.

start

public void start()
Starts the timer.

time

public long time()
Gets the Timer indication.