diff --git a/docs/Spring/clazz/Spring-StopWatch.md b/docs/Spring/clazz/Spring-StopWatch.md index f075af7..fd68d09 100644 --- a/docs/Spring/clazz/Spring-StopWatch.md +++ b/docs/Spring/clazz/Spring-StopWatch.md @@ -1,18 +1,18 @@ # Spring StopWatch - Author: [HuiFer](https://github.com/huifer) -- 源码阅读仓库: [SourceHot-spring](https://github.com/SourceHot/spring-framework-read) +- 婧愮爜闃呰浠撳簱: [SourceHot-spring](https://github.com/SourceHot/spring-framework-read) -- 全路径: `org.springframework.util.StopWatch` -## 属性 -- taskList: 任务信息列表 -- keepTaskList: 是否保留任务信息列表 -- startTimeMillis: 任务开始的时间 -- currentTaskName: 任务名称 -- lastTaskInfo: 任务信息 -- taskCount: 任务数量 -- totalTimeMillis: 总共花费的时间 +- 鍏ㄨ矾寰: `org.springframework.util.StopWatch` +## 灞炴 +- taskList: 浠诲姟淇℃伅鍒楄〃 +- keepTaskList: 鏄惁淇濈暀浠诲姟淇℃伅鍒楄〃 +- startTimeMillis: 浠诲姟寮濮嬬殑鏃堕棿 +- currentTaskName: 浠诲姟鍚嶇О +- lastTaskInfo: 浠诲姟淇℃伅 +- taskCount: 浠诲姟鏁伴噺 +- totalTimeMillis: 鎬诲叡鑺辫垂鐨勬椂闂 -## 方法 +## 鏂规硶 - `org.springframework.util.StopWatch.start(java.lang.String)` ```java public void start(String taskName) throws IllegalStateException { @@ -29,10 +29,10 @@ if (this.currentTaskName == null) { throw new IllegalStateException("Can't stop StopWatch: it's not running"); } - // 消费的时间 + // 娑堣垂鐨勬椂闂 long lastTime = System.currentTimeMillis() - this.startTimeMillis; this.totalTimeMillis += lastTime; - // 任务信息初始化 + // 浠诲姟淇℃伅鍒濆鍖 this.lastTaskInfo = new TaskInfo(this.currentTaskName, lastTime); if (this.keepTaskList) { this.taskList.add(this.lastTaskInfo);