import cn.hutool.core.date.StopWatch;
import cn.hutool.core.thread.ThreadUtil;
StopWatch test = new StopWatch("test");
test.start("task1");
ThreadUtil.sleep(1000);
test.stop();
test.start("task2");
ThreadUtil.sleep(3000);
test.stop();
System.out.println("test.prettyPrint()~~~~~~~~~~~~~~~~~");
System.out.println(test.prettyPrint());
System.out.println("test.shortSummary()~~~~~~~~~~~~~~~~~");
System.out.println(test.shortSummary());
System.out.println("sw.getTotalTimeMillis()~~~~~~~~~~~~~~~~~");
System.out.println(test.getTotalTimeMillis());
标签:java,程序运行,StopWatch,System,优雅,println,test,ThreadUtil,out
From: https://www.cnblogs.com/fuqian/p/17344385.html