原文:https://www.jianshu.com/p/13bda7d606cc
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.StopWatch;
import java.text.NumberFormat;
/**
* @Classname StopWatchExpand
* @Description 断点计算方法耗时
* 编辑断点,取消Suspend
* 第一个断点:
* StopWatchExpand.init();
* StopWatchExpand.start("第一个任务名称");
* 第二个断点:
* StopWatchExpand.stop();
* StopWatchExpand.start("第二个任务名称");
* ......
* 最后一个断点:
* StopWatchExpand.stop();
* * StopWatchExpand.prettyPrint();
* @Date 2022/6/22 11:39
*/
@Slf4j
public class StopWatchExpand {
/**
* StopWatch实例
*/
private static StopWatch STOP_WATCH;
/**
* StopWatch实例初始化
*/
public static void init() {
STOP_WATCH = new StopWatch("运行时间");
}
/**
* 开启计时
*
* @param