package com.tngtech.jgiven.impl;

public class Timer {
  private long startNanoseconds;
  private long elapsedTime = -1L;

  public Timer() {
    startNanoseconds = System.nanoTime();
  }

  public void reset() {
    elapsedTime = -1L;
    startNanoseconds = System.nanoTime();
  }

  public long stop() {
    if (elapsedTime != -1L)
      return elapsedTime;
    elapsedTime = System.nanoTime() - startNanoseconds;
    return elapsedTime;
  }
}

Add timer class for tests
Add timer class for tests

Signed-off-by: Andru Stefanescu <7ddc31439e278e07060dec99cf8ddedbee60ab4a@cam.ac.uk>
