ru.sscc.util
Class TimeCounter

java.lang.Object
  |
  +--ru.sscc.util.TimeCounter

public class TimeCounter
extends java.lang.Object

An instance of this class is a simple timer that allows to count a time spent from the construction or the last restart of the timer.


Constructor Summary
TimeCounter()
          Constructs the timer and starts it.
 
Method Summary
 void restart()
          Restarts the timer.
 long timeMillis()
          Returns the time in millis spent from the last restart.
 java.lang.String toString()
          Returns the spent time in the form "s.mmm" with millis after the decimal point.
static java.lang.String toString(long timeMillis)
          Converts a time in millis to the form "s.mmm" with millis after the decimal point.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TimeCounter

public TimeCounter()
Constructs the timer and starts it.
Method Detail

restart

public void restart()
Restarts the timer.

timeMillis

public long timeMillis()
Returns the time in millis spent from the last restart.

toString

public static java.lang.String toString(long timeMillis)
Converts a time in millis to the form "s.mmm" with millis after the decimal point.

toString

public java.lang.String toString()
Returns the spent time in the form "s.mmm" with millis after the decimal point.
Overrides:
toString in class java.lang.Object