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);

 

posted @ 2018-11-05 17:52  FrankYou  阅读(2551)  评论(0编辑  收藏  举报