@@ -0,0 +1,940 @@
+package net.sf.kerner.utils.time;%0A%0Apublic class StopWatch %7B%0A%09%0A%09public class AlreadyRunningException extends RuntimeException %7B%0A%0A%09%09private static final long serialVersionUID = -8543832250156761882L;%0A%09%09%0A%09%7D%0A%09%0A%09public class NotRunningException extends RuntimeException %7B%0A%0A%09%09private static final long serialVersionUID = 2016104424322122373L;%0A%09%09%0A%09%7D%0A%09%0A%09private long time = -1;%0A%09%0A%09public synchronized void start() throws AlreadyRunningException %7B%0A%09%09if(time %3E 0) throw new AlreadyRunningException();%0A%09%09time = System.currentTimeMillis();%0A%09%7D%0A%09%0A%09public synchronized TimePeriod round() throws NotRunningException %7B%0A%09%09if(time %3C 0) throw new NotRunningException();%0A%09%09return new TimePeriod(time, System.currentTimeMillis());%0A%09%7D%0A%09%0A%09public synchronized TimePeriod stop() throws NotRunningException %7B%0A%09%09final long result = time;%0A%09%09if(result %3C 0) throw new NotRunningException();%0A%09%09time = -1;%0A%09%09return new TimePeriod(result, System.currentTimeMillis());%0A%09%7D%0A%0A%7D%0A

Introduce StopWatch.