【发布时间】:2015-10-24 19:39:24
【问题描述】:
我的 Android 代码有几种方法,我正在使用 AspectJ 在 Android 中查找每个方法的执行时间。为此,我正在使用 -
pointcut methodCalls():
execution(* com.example.buttontestaspect..*(..))&& !within(com.example.buttontestaspect.testbutton);
before(): methodCalls(){
start = System.currentTimeMillis();//Start of execution time of method
Log.d("hi", "start = " + start);
}
after(): methodCalls(){
double end = System.currentTimeMillis();//End of execution time of method
Log.d("hi", "end = " + end);
double t = (end - start);
}
每当开始执行新方法时,我都会检查 before() 中的开始时间值。它始终是常数,等于 1.445714916545E12。这是正确的还是我做错了什么?
【问题讨论】: