티스토리 뷰
실행시간 측정하는 3가지 방법
StopWatch - spring
StopWatch stopWatch = new StopWatch();
stopWatch.start();
//...
//...
//...
stopWatch.stop();
System.out.println("소요시간:"+stopWatch.getTotalTimeMillis()+"ms");
System.out.println(stopWatch.prettyPrint());
* apache comm-lang3에서도 제공되지만 둘다 thread safe 하지 않음
Instant
Instant stime = Instant.now();
//...
//...
//...
Instant etime = Instant.now();
System.out.println("소요시간:"+Duration.between(stime, etime).toMillis()+"ms");
System.currentTimeMillis()
long stime = System.currentTimeMillis();
//...
//...
//...
System.out.println("소요시간:"+(System.currentTimeMillis()-stime)+"ms");
'Java' 카테고리의 다른 글
| 람다 표현식 간단 정리 (0) | 2021.05.07 |
|---|---|
| [JUnit]System.out.println ()의 단위 테스트 예제 (0) | 2021.05.07 |
| 이클립스에서 static import 쉽게 가져오기 (0) | 2021.05.04 |
| String format 사용법 (0) | 2020.04.07 |
| [java]6자리 인증 번호 생성하기 예제 (0) | 2020.04.07 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- cache
- RESTful
- 엑셀
- mapToList
- thymeleaf
- REST
- oracle
- java
- AG-GRID
- example
- 메시지
- sample
- Javascript
- Spring Boot
- UI
- SHEETJS
- lombok
- 타임리프
- springboot
- spring
- 스프링부트
- ag grid
- 그리드
- mybatis
- restful서비스
- 설정
- 예제
- 스프링
- 샘플
- listToMap
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |
글 보관함