// a stopwatch class used to measure time public class Stopwatch { // time when the stopwatch was started private double startTime; public Stopwatch() { startTime = System.currentTimeMillis(); } public double getElapsedMilliseconds() { return System.currentTimeMillis() - startTime; } public double getElapsedSeconds() { return this.getElapsedMilliseconds() / 1000; } public void reset() { startTime = System.currentTimeMillis(); } }