测试某个方法的运行耗时:
long startTime = System.currentTimeMillis(); //起始时间
long runTime = 0;
{测试的方法}
long endTime = System.currentTimeMillis(); //结束时间
runTime = endTime - startTime;
Log.d(TAG,"耗时:"+runTime+"ms");
测试某个方法的运行耗时:
long startTime = System.currentTimeMillis(); //起始时间
long runTime = 0;
{测试的方法}
long endTime = System.currentTimeMillis(); //结束时间
runTime = endTime - startTime;
Log.d(TAG,"耗时:"+runTime+"ms");