Major cleanup of Utils class.
[trakem2.git] / ini / trakem2 / utils / StopWatch.java
blob8298bbf7c02e64b02f6e9c87b20a97984567dec8
1 package ini.trakem2.utils;
3 public class StopWatch {
5 private long start;
6 private long start2;
8 public StopWatch() {
9 start = start2 = System.currentTimeMillis();
10 System.out.println("StopWatch started.");
12 /** Time elapsed since last call to this method or the start. */
13 public void elapsed(String msg) {
14 long now = System.currentTimeMillis();
15 Utils.log("Elapsed: " + (now - start2) + " at: " + msg);
16 start2 = now;
18 /** Total time transcurred from the start. */
19 public void cumulative() {
20 long now = System.currentTimeMillis();
21 Utils.log("Cumulative: " + (now - start));