com.ibatis.common.util
Class Stopwatch

java.lang.Object
  extended bycom.ibatis.common.util.Stopwatch

public class Stopwatch
extends java.lang.Object

Stopwatch class used for testing.


Constructor Summary
Stopwatch()
           
 
Method Summary
 long getAvgTaskTime(java.lang.String taskName)
          Get the average time added to a task
 long getMaxTaskTime(java.lang.String taskName)
          Get the maximum time added to a task
 long getMinTaskTime(java.lang.String taskName)
          Get the minimum time added to a task
 long getTaskCount(java.lang.String taskName)
          Get the number of times assigned to a task
 java.util.Iterator getTaskNames()
          Get an iterator of the tasks
 long getTotalTaskTime(java.lang.String taskName)
          Get the total time added to a task
 void mergeStopwatch(Stopwatch watch)
          Merge another StopWatch into this one
 void reset()
          Reset all of the timers in this StopWatch
 void start(java.lang.String taskName)
          Start (create) a task
 void stop()
          Stop the timer on a task
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Stopwatch

public Stopwatch()
Method Detail

getTaskNames

public java.util.Iterator getTaskNames()
Get an iterator of the tasks

Returns:
- the Iterator

getTaskCount

public long getTaskCount(java.lang.String taskName)
Get the number of times assigned to a task

Parameters:
taskName - - the name of the task
Returns:
- the number of times

getTotalTaskTime

public long getTotalTaskTime(java.lang.String taskName)
Get the total time added to a task

Parameters:
taskName - - the name of the task
Returns:
- the total time added to the task

getMaxTaskTime

public long getMaxTaskTime(java.lang.String taskName)
Get the maximum time added to a task

Parameters:
taskName - - the name of the task
Returns:
- the maximum time added to a task

getMinTaskTime

public long getMinTaskTime(java.lang.String taskName)
Get the minimum time added to a task

Parameters:
taskName - - the name of the task
Returns:
- the minimum time added to a task

getAvgTaskTime

public long getAvgTaskTime(java.lang.String taskName)
Get the average time added to a task

Parameters:
taskName - - the name of the task
Returns:
- the average time added to a task

start

public void start(java.lang.String taskName)
Start (create) a task

Parameters:
taskName - - the name of the task

stop

public void stop()
Stop the timer on a task


mergeStopwatch

public void mergeStopwatch(Stopwatch watch)
Merge another StopWatch into this one

Parameters:
watch - - the StopWatch to merge into this one

reset

public void reset()
Reset all of the timers in this StopWatch


toString

public java.lang.String toString()