Google Guava Stopwatch(计时器)
Stopwatch stopwatch =newStopwatch().start(); //do something test for(int i =0; i <10000; i++){
} long nanos = stopwatch.elapsed(TimeUnit.NANOSECONDS); System.out.println(nanos);
Stopwatch stopwatch =newStopwatch().start(); //do something test for(int i =0; i <10000; i++){
} long nanos = stopwatch.elapsed(TimeUnit.NANOSECONDS); System.out.println(nanos);