long startTime=System.currentTimeMillis();//記錄開始時間
method();//此處為你調用的方法
long endTime=System.currentTimeMillis();//記錄結束時間
float excTime=(float)(endTime-startTime)/1000;
System.out.println("執行時間:"+excTime+"s");
long startTime=System.currentTimeMillis();//記錄開始時間
method();//此處為你調用的方法
long endTime=System.currentTimeMillis();//記錄結束時間
float excTime=(float)(endTime-startTime)/1000;
System.out.println("執行時間:"+excTime+"s");