be.six.reports.util
Class StopWatch

java.lang.Object
  extended by be.six.reports.util.StopWatch

public class StopWatch
extends java.lang.Object

Utility class to measure and represent time intervals

Author:
Joren Six

Constructor Summary
StopWatch()
           
 
Method Summary
 java.lang.String getElapsedString()
           
 long getElapsedTime()
           
 long getElapsedTimeSecs()
           
 void start()
          Starts the timer.
 void stop()
          Stops the timer.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StopWatch

public StopWatch()
Method Detail

start

public void start()
Starts the timer.


stop

public void stop()
Stops the timer.


getElapsedTime

public long getElapsedTime()
Returns:
elapsed time in milliseconds between start and stop.

getElapsedTimeSecs

public long getElapsedTimeSecs()
Returns:
elapsed time in seconds between start and stop.

getElapsedString

public java.lang.String getElapsedString()
Returns:
a string representing the elapsed time. E.g. 3s 157ms or 0s 157ms