counter.initSum((int)0); long startTime = System.currentTimeMillis(); for (int i=0; i i++) ; { counter.increment(); } long stopTime = System.currentTimeMillis(); System.out.println("Avg Ping = " + ((stopTime-startTime)/1000f) + "msecs"); System.out.println("Sum = " + counter.sum()); } ...// catch exceptions } |