问题描述
基本上,我需要使用自定义注释来跟踪在方法中花费的时间。 (我知道spring AOP可以用于这个,但我们不能在我们的产品中使用它)
public class TimeCounterDemo {
@TimeCounter
public void trackMyTimeSpentUsingAnnotation()
{
//some heavy processing stuff
}
}
public @interface TimeCounter {
//need help with this implementation.
}
所以,我的要求是完成 TimeCounter
注释。
要求很简单 -
- 记录方法启动的时间。
- 记录方法结束的时间。
- 记录在方法中花费的总时间。
- 执行的方法名称
有人可以帮助说明如何根据上述要求实现此注释。
提前致谢。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)