StopWatch2.


// StopWatch2.java

package StopWatch;

import java.util.*;

public class StopWatch2 extends StopWatch
{
  public void start()
  {
    super.start();
    _elapsedTime = 0;
  }

  public long display1()
  {
    return super.display1() + _elapsedTime;
  }

  public long display2()
  {
    return super.display2() + _elapsedTime;
  }

  public void pause()
  {
    long currTime = new Date().getTime();
    _elapsedTime += currTime - _startTime;

    _startTime = 0;
    _stopTime  = 0;
  }

  public void resume()
  {
    _startTime = new Date().getTime();
  }

  public void nop()
  {
  }

  long _elapsedTime;
}