shenyixin
long startTime=System.currentTimeMillis();//记录开始时间  
  
method();//此处为你调用的方法  
  
long endTime=System.currentTimeMillis();//记录结束时间  
  
float excTime=(float)(endTime-startTime)/1000;  
  
System.out.println("执行时间:"+excTime+"s"); 

 

分类:

技术点:

相关文章: