使用stopWatch计算耗时

不规范代码

final long start = System.currentTimeMillis();
doSomething();
final long during = System.currentTimeMillis() - start;

可以使用 Apache Commons Lang3提供的stopWatch替代System.currentTimeMillis()手工计算耗时

posted @ 2022-10-11 15:57  grillar  阅读(37)  评论(0)    收藏  举报