3738394041424344454647
for( int i = 0; i < iterations; i++ ) { Thread.sleep(10+ (long)(Math.random() * 10)); } sw.stop("ok"); assertEquals("ok", sw.getTag()); assertTrue( sw.getTimeMicros() > iterations*10*1000L ); // No way this could be faster
6465666768697071727374
{ StopWatch sw = swf.getStopWatch("foo"); // Do nothing sw.stop("iteration:success"); } total.stop("total"); time = System.currentTimeMillis() - time;