public class Stopwatch { private double startTime; public Stopwatch() { this.reset(); } public double read() { return System.currentTimeMillis() - startTime; } public double readSeconds() { return this.read() / 1000; } public void reset() { startTime = System.currentTimeMillis(); } }