Long startTime=System.currentTimeMillis();
for (int i = 0; i < 1000; i++) {
System.out.println(i+"编号:"+Math.random());
}
//执行方法
long endTime=System.currentTimeMillis();
float excTime=(float)(endTime-startTime)/1000;
System.out.println("执行时间:"+excTime+"s");
}- 本文固定链接: http://www.ypbj.cc/post/189.html
- 转载请注明: yupang 于 余胖笔记 发表
《本文》有 0 条评论