com.partnersoft.v3x.gadgets
Class ProgressTrackingWatch

java.lang.Object
  extended by com.partnersoft.v3x.gadgets.ProgressTrackingWatch

public class ProgressTrackingWatch
extends java.lang.Object

Tracks the progress of some long, multistep sequence. Can provide averages, estimates, etc.


Constructor Summary
ProgressTrackingWatch(int numberOfSteps, int peepholeSize)
          Creates a new ProgressTrackingWatch for a process with the given number of steps.
 
Method Summary
 double getAverage()
          Get the average time for all runs.
 long getCurrentTime()
          Get the time since last start.
 long getLastTime()
          Get the last timing run.
 int getNumRuns()
          Get the number of timing runs.
 long getTotalTime()
          Get the total of all timing runs.
 void reset()
          Reset everything.
 void start()
          Start the clock.
 void stop()
          Stop the clock.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProgressTrackingWatch

public ProgressTrackingWatch(int numberOfSteps,
                             int peepholeSize)
Creates a new ProgressTrackingWatch for a process with the given number of steps. The peepholeSize determines the number of steps it uses to compute the peepholeAverage.

Method Detail

start

public void start()
Start the clock.


stop

public void stop()
Stop the clock.


getLastTime

public long getLastTime()
Get the last timing run. If you've buggered up stops and starts that's your lookout.


getTotalTime

public long getTotalTime()
Get the total of all timing runs.


getCurrentTime

public long getCurrentTime()
Get the time since last start.


getNumRuns

public int getNumRuns()
Get the number of timing runs.


getAverage

public double getAverage()
Get the average time for all runs.


reset

public void reset()
Reset everything.