Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/218.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用AspectJ的Android方法执行时间_Android_Aspectj - Fatal编程技术网

使用AspectJ的Android方法执行时间

使用AspectJ的Android方法执行时间,android,aspectj,Android,Aspectj,我的Android代码有几个方法,我使用AspectJ在Android中查找每个方法的执行时间。为此,我正在使用- pointcut methodCalls(): execution(* com.example.buttontestaspect..*(..))&& !within(com.example.buttontestaspect.testbutton); before(): methodCalls(){ start = System.

我的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()中检查start time的值。它总是常数,等于1.445714916545E12。这是正确的还是我做错了什么?

System.currentTimeMillis()返回一个long,但您正在将它插入一个double。我会试着把它改成长的,看看这是否奏效