long startTime=System.currentTimeMillis();
//需要测试的代码块
long endTime=System.currentTimeMillis();
//计算输出结果(ms毫秒)
System.out.println("当前程序耗时:"+(endTime-startTime)+"ms");
long startTime=System.currentTimeMillis();
//需要测试的代码块
long endTime=System.currentTimeMillis();
//计算输出结果(ms毫秒)
System.out.println("当前程序耗时:"+(endTime-startTime)+"ms");