com.planeth.common.timing
Class AbstractStopWatch

java.lang.Object
  extended bycom.planeth.common.timing.AbstractStopWatch
Direct Known Subclasses:
MilliStopWatch, NanoStopWatch

public abstract class AbstractStopWatch
extends java.lang.Object

Abstract Base StopWatch

Author:
Andreas Grässer, gal@planet-h.com
created 14.01.2006

Constructor Summary
AbstractStopWatch()
          Constructor for AbstractStopWatch.
 
Method Summary
static AbstractStopWatch createStopWatch()
          Creates a supported StopWatch instance for the current java runtime
abstract  void fwind(long millis)
          Goes a defined number of millis forward
abstract  long getElapsedMillis()
          Returns the elapsed millis since last reset
protected  long getStartTime()
          Returns the startTime.
abstract  void reset()
          Resets the StopWatch (to zero)
protected  void setStartTime(long startTime)
          Sets the startTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractStopWatch

public AbstractStopWatch()
Constructor for AbstractStopWatch.

Method Detail

createStopWatch

public static AbstractStopWatch createStopWatch()
Creates a supported StopWatch instance for the current java runtime

Returns:
Returns a supported StopWatch instance for the current java runtime

reset

public abstract void reset()
Resets the StopWatch (to zero)


fwind

public abstract void fwind(long millis)
Goes a defined number of millis forward

Parameters:
millis -

getElapsedMillis

public abstract long getElapsedMillis()
Returns the elapsed millis since last reset

Returns:
elapsed time since last reset

getStartTime

protected long getStartTime()
Returns the startTime.

Returns:
Returns the startTime.

setStartTime

protected void setStartTime(long startTime)
Sets the startTime

Parameters:
startTime - The startTime to set.