org.placidus.performance
Class StopWatch

java.lang.Object
  extended by org.placidus.performance.StopWatch
Direct Known Subclasses:
NanoStopWatch

public class StopWatch
extends java.lang.Object

This class is for measuring times.

Author:
ds

Constructor Summary
StopWatch()
          StopWatch automatically starts at new instance
 
Method Summary
protected  long getCurrentTime()
          Returns new timestamp
 long getTime()
          to get current time (interim), no reset will be performed.
 void printTime()
          prints current time to System.out (toString)
 void reset()
          to reset stopwatch to 0
 java.lang.String toString()
          to get current time (interim), no reset will be performed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StopWatch

public StopWatch()
StopWatch automatically starts at new instance

Method Detail

reset

public void reset()
to reset stopwatch to 0


getTime

public long getTime()
to get current time (interim), no reset will be performed.


getCurrentTime

protected long getCurrentTime()
Returns new timestamp

Returns:
new timestamp, current time

toString

public java.lang.String toString()
to get current time (interim), no reset will be performed.

Overrides:
toString in class java.lang.Object

printTime

public void printTime()
prints current time to System.out (toString)



Copyright © 2006 DS. All Rights Reserved.