@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");
}
}
}
AOP 적용 전

AOP 적용 후

AOP 적용 전

AOP 적용 후
