Timer.java

  1. package org.jbehave.core.steps;

  2. public class Timer {
  3.     private long start;
  4.     private long end;

  5.     public Timer start() {
  6.         start = System.currentTimeMillis();
  7.         return this;
  8.     }

  9.     public Timer stop() {
  10.         end = System.currentTimeMillis();
  11.         return this;
  12.     }

  13.     public long getStart() {
  14.         return start;
  15.     }

  16.     public long getEnd() {
  17.         return end;
  18.     }

  19.     public long getDuration() {
  20.         return end - start;
  21.     }
  22. }