for (int i = 0; i < 1000; i++) {
long id = Stopwatch.start("g", "l");
Stopwatch.stop(id);
}
Report report = Stopwatch.getSingleReport("g", "l");
System.out.print(report);
Group="g" Label="l" Count=1000 Min=0.0 Avg=0.0 Max=0.0 Total=0.0but instead the output will be somethimg similar to:
Group="g" Label="l" Count=1000 Min=0.0 Avg=0.0 Max=1.0 Total=8.0The reason is that running Stopwatch itself takes some milliseconds. An efforts have been made to minimize this overhead (on my machine it's ~0.8%) since it can not be completely eliminated.