Home [Development] StopWatch
Post
Cancel

[Development] StopWatch

StopWatch

  • allowing for timing of a number of tasks, exposing total running time and running time for each named task.

Methods

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
@Slf4j
public class ... {
StopWatch stopwatch = new StopWatch();

stopWatch.start();
// logic 1
stopWatch.stop();

log.info("stopwatch 1 : " + stopWatch.getTotalTimeSeconds());

stopWatch.start();
// logic 2
stopWatch.stop();
log.info("stopwatch 2 : " + stopWatch.getTotalTimeSeconds());

// Generate a string with a table describing all tasks performed.
log.info(stopWatch.prettyPrint());

}


https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/util/StopWatch.html

This post is licensed under CC BY 4.0 by the author.

[Tokyo] 在留期間更新申請

[Development] ElasticSearch - UpdateByQuery

Comments powered by Disqus.