//在你的方法第一行加上: long a=System.currentTimeMillis(); //在最后的一行加上: System.out.println("\r<br>执行耗时 : "+(System.currentTimeMillis()-a)/1000f+" 秒 ");