long startTime=System.currentTimeMillis();
//執行方法
long endTime=System.currentTimeMillis();
float excTime=(float)(endTime-startTime)/1000;
System.out.println("執行時間:"+excTime+"s");