Class Stopwatch

java.lang.Object
  extended by Stopwatch

public class Stopwatch
extends java.lang.Object

A class to measure time elapsed.


Field Summary
static double NANOS_PER_SEC
           
 
Constructor Summary
Stopwatch()
           
 
Method Summary
 void start()
          start the stop watch.
 void stop()
          stop the stop watch.
 double time()
          elapsed time in secods.
 long timeInNanoseconds()
          elapsed time in nanoseconds.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NANOS_PER_SEC

public static final double NANOS_PER_SEC
See Also:
Constant Field Values
Constructor Detail

Stopwatch

public Stopwatch()
Method Detail

start

public void start()
start the stop watch.


stop

public void stop()
stop the stop watch.


time

public double time()
elapsed time in secods.

Returns:
the time recorded on the stopwatch in seconds

toString

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

timeInNanoseconds

public long timeInNanoseconds()
elapsed time in nanoseconds.

Returns:
the time recorded on the stopwatch in nanoseconds