mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
remove TimeInterval
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package cn.hutool.extra.aop.aspects;
|
||||
|
||||
import cn.hutool.core.date.TimeInterval;
|
||||
import cn.hutool.core.date.StopWatch;
|
||||
import cn.hutool.core.lang.Console;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
@@ -13,7 +13,7 @@ import java.lang.reflect.Method;
|
||||
public class TimeIntervalAspect extends SimpleAspect {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final TimeInterval interval = new TimeInterval();
|
||||
private final StopWatch interval = new StopWatch();
|
||||
|
||||
@Override
|
||||
public boolean before(final Object target, final Method method, final Object[] args) {
|
||||
@@ -23,10 +23,11 @@ public class TimeIntervalAspect extends SimpleAspect {
|
||||
|
||||
@Override
|
||||
public boolean after(final Object target, final Method method, final Object[] args, final Object returnVal) {
|
||||
interval.stop();
|
||||
Console.log("Method [{}.{}] execute spend [{}]ms return value [{}]",
|
||||
target.getClass().getName(), //
|
||||
method.getName(), //
|
||||
interval.intervalMs(), //
|
||||
interval.getLastTaskTimeMillis(), //
|
||||
returnVal);
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user