com.generationjava.test
Class StopWatch

java.lang.Object
  |
  +--com.generationjava.test.StopWatch

public class StopWatch
extends java.lang.Object

Useful when doing timings in a test.


Constructor Summary
StopWatch()
           
 
Method Summary
 long getTime()
          Get the time on the stopwatch.
 java.lang.String getTimeString()
          Get the time gap as a String.
static void main(java.lang.String[] strs)
           
 void reset()
          Reset the stopwatch.
 void split()
          Split the time.
 void start()
          Start the stopwatch.
 void stop()
          Stop the stopwatch.
 java.lang.String toString()
           
 void unsplit()
          Remove a split.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StopWatch

public StopWatch()
Method Detail

main

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

start

public void start()
Start the stopwatch.


stop

public void stop()
Stop the stopwatch.


reset

public void reset()
Reset the stopwatch.


split

public void split()
Split the time.


unsplit

public void unsplit()
Remove a split.


getTime

public long getTime()
Get the time on the stopwatch. This is either the time between start and latest split, between start and stop, or the time between the start and the moment this method is called.


toString

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

getTimeString

public java.lang.String getTimeString()
Get the time gap as a String. In hours, minutes, seconds and milliseconds.



Copyright © 2000-2003 GenerationJava. All Rights Reserved.