grace.util
Class Timer

java.lang.Object
  |
  +--grace.util.Timer

public class Timer
extends java.lang.Object

This is a simple, general purpose timer useful for finding the duration of time between a sequence of start and stop events. The typical use of this timer is to create it, start it, stop it, and read the duration of time that has elapsed between the start and stop. However, the timer will accumate all times between subsequent start and stop events so the timer can be started and stopped manny times before it is zeroed. Also, the timer does not need to be stopped in order to read the duration.


Constructor Summary
Timer()
           
Timer(Timer toCopy)
           
 
Method Summary
 double duration()
           
 long durationInMilliSeconds()
           
 boolean isStopped()
           
static void main(java.lang.String[] args)
           
 void start()
           
 void stop()
           
 java.lang.String toString()
           
 void zero()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Timer

public Timer()

Timer

public Timer(Timer toCopy)
Method Detail

start

public void start()

stop

public void stop()

isStopped

public boolean isStopped()

zero

public void zero()

durationInMilliSeconds

public long durationInMilliSeconds()

duration

public double duration()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

main

public static void main(java.lang.String[] args)