시간측정
@Aspect
@Component
public class TimeTraceAop {
@Around("execution(* hello.hellospring..*(..))")
public Object execute(ProceedingJoinPoint joinPoint) throws Throwable {
long start = System.currentTimeMillis();
System.out.println("START: " + joinPoint.toString());
try {
return joinPoint.proceed();
} finally {
long finish = System.currentTimeMillis();
long timeMs = finish - start;
System.out.println("END: " + joinPoint.toString()+ " " + timeMs + "ms");
}
}
}
'Spring > Basic' 카테고리의 다른 글
[Basic] AppConfig (0) | 2024.04.03 |
---|---|
[Basic] 설계 (0) | 2024.04.03 |
[Basic] 사고 방법 (0) | 2024.04.03 |
[Basic] 기타 정보 (0) | 2024.04.03 |
[Basic] h2base 설정 (0) | 2024.04.03 |