zoukankan      html  css  js  c++  java
  • apo 简单参考

    参考: https://www.cnblogs.com/Geyoung/p/6927905.html

    @Aspect
    @Component
    public class TimeAspect {
        //通过这种方法可以拿到对象中所有的方法,对象
        @Around("execution(* com.imooc.web.controller.UserController.*(..))")
        public Object handleControllerMethod(ProceedingJoinPoint pjp) throws Throwable {
            
            System.out.println("time aspect start");
            
            Object[] args = pjp.getArgs();
            for (Object arg : args) {  
                System.out.println("arg is "+arg);
            }
            
            long start = new Date().getTime();
            
            Object object = pjp.proceed();
            
            System.out.println("time aspect 耗时:"+ (new Date().getTime() - start));
            
            System.out.println("time aspect end");
            
            return object;
        }
    
    }
    View Code
  • 相关阅读:
    洛谷单元最短路标准版——spfa优化
    airline
    有依赖的背包
    挖地雷
    带分数问题
    子集和问题
    循环比赛日程表
    传纸条
    机器分配
    分组背包
  • 原文地址:https://www.cnblogs.com/lshan/p/8688477.html
Copyright © 2011-2022 走看看