com.ecyrd.speed4j
Class LoggingStopWatch

java.lang.Object
  extended by com.ecyrd.speed4j.StopWatch
      extended by com.ecyrd.speed4j.LoggingStopWatch
All Implemented Interfaces:
Serializable

public class LoggingStopWatch
extends StopWatch

A version of StopWatch which outputs the result upon stop() to the internal Log. This is the version you most probably need.

See Also:
Serialized Form

Constructor Summary
protected LoggingStopWatch(Log log, String tag, String message)
          Creates a LoggingStopWatch associated with the given Log.
 
Method Summary
protected  void internalStop()
          If the log exists and is enabled, sends this StopWatch to the given Log to be logged.
 
Methods inherited from class com.ecyrd.speed4j.StopWatch
freeze, getCreationTime, getMessage, getTag, getTimeNanos, lap, start, stop, stop, stop, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LoggingStopWatch

protected LoggingStopWatch(Log log,
                           String tag,
                           String message)
Creates a LoggingStopWatch associated with the given Log.

Parameters:
log - The Log that is used by this StopWatch to output.
tag - The tag.
message - A free-form message.
Method Detail

internalStop

protected void internalStop()
If the log exists and is enabled, sends this StopWatch to the given Log to be logged.

Overrides:
internalStop in class StopWatch


Copyright © 2011. All Rights Reserved.