Skip to content

Commit d31571a

Browse files
StopWatch,耗时,任务名称
1 parent 9e6b408 commit d31571a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/java/com/performance/StopWatchDemo.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,13 @@ public static void stopWatch() throws InterruptedException {
2020
Thread.sleep(1000);
2121
stopWatch.stop();
2222

23-
//统计耗时
23+
System.out.println("总耗时以及各个任务耗时如下:\n");
2424
System.out.println(stopWatch.prettyPrint());
25+
System.out.println("总耗时:"+ stopWatch.getTotalTimeMillis());
26+
System.out.println("最后一个任务的线程名称:"+ stopWatch.getLastTaskName());
27+
28+
29+
2530
}
2631

2732

0 commit comments

Comments
 (0)