An around advice is the most powerful type of advice; it can completely replace the target method by some different code. In this recipe, we will use it only to execute some extra code before and after the target method. With the before code, we will get the current time. With the after code, we will get the current time again, and will compare it to the previous time to calculate the total time the target method took to execute. Our target methods will be the controller methods of the controller classes in the controller package.
We will use the aspect class defined in the previous recipe, Creating a Spring AOP aspect class.