Spring-StopWatch
Spring StopWatch Author: HuiFer 源码阅读仓库: SourceHot-spring 全路径: org.springframework.util.StopWatch 属性 taskList: 任务信息列表 keepTaskList: 是否保留任务信息列表 startTimeMillis: 任务开始的时间 currentTaskName: 任务名称 lastTaskInfo: 任务信息 taskCount: 任务数量 totalTimeMillis: 总共花费的时间 方法 org.springframework.util.StopWatch.start(java.lang.String) 1 2 3 4 5 6 7 public void start(String taskName) throws IllegalStateException { if (this.currentTaskName != null) { throw new IllegalStateException("Can't start StopWatch: it's already running"); } this.currentTaskName = taskName; this.startTimeMillis = System.currentTimeMillis(); } org.springframework.util.StopWatch.stop 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 public void stop() throws IllegalStateException { if (this.currentTaskName == null) { throw new IllegalStateException("Can't stop StopWatch: it's not……