code: public void nextStage(String name) throws IOException {
      endStage();
      this.currentStage = name;
      this.currentStageStart = System.currentTimeMillis();
    }
docs: End the previous stage, record the time spent in that stage, and start the timer for a new stage.
  @param name name of the new stage.
  @throws IOException