计算机处理速度测试

---恢复内容开始---

public class Test{
public static void main(String[] args){
long startTime = System.currentTimeMillis();
long endTime = startTime + 60000;
long index = 0;
while(true){
double x = Math.sqrt(index);
long now = System.currentTimeMillis();
if (now > endTime){
break;
}
index++;
}
System.out.println(index + " loops in one minute");
}
}

---恢复内容结束---

原文地址:https://www.cnblogs.com/Muzeer/p/7299962.html