de.twenty11.unitprofile.domain
Class Clock

java.lang.Object
  extended by de.twenty11.unitprofile.domain.Clock

public class Clock
extends Object

clock implementation to keep track of durations


Constructor Summary
Clock()
          creates and starts a clock.
 
Method Summary
 long getElapsed()
           
 long getEnd()
           
 long getStart()
           
 boolean isStopped()
           
 void stop()
          stops the clock
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Clock

public Clock()
creates and starts a clock.

Method Detail

stop

public void stop()
stops the clock


getStart

public long getStart()

getEnd

public long getEnd()
Returns:
current time if not stopped yet; otherwise time when stop method was called.

isStopped

public boolean isStopped()
Returns:
has the clock been stopped

getElapsed

public long getElapsed()
Returns:
time elapsed since starting (when not stopped yet); otherwise total elapsed time between creation and call of stop method.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013. All rights reserved.