StopWatch stopWatch=new StopWatch();
stopWatch.start("...");
stopWatch.stop();
logger.info("耗时分析:"+stopWatch.prettyPrint());

方法:
getTime(); 统计从start到现在的计时
未完待续…
本文介绍了一种使用StopWatch工具类监控代码执行时间的方法,通过start和stop方法记录不同代码段的运行时间,最后利用prettyPrint方法输出详细的耗时分析报告。
StopWatch stopWatch=new StopWatch();
stopWatch.start("...");
stopWatch.stop();
logger.info("耗时分析:"+stopWatch.prettyPrint());

方法:
getTime(); 统计从start到现在的计时
未完待续…
179
1625
503
2533
2354

被折叠的 条评论
为什么被折叠?