public static void main(String[] args) {
long startTime = System.currentTimeMillis();
long endTime = startTime + 6000;
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 6 seconds");
}
CPU性能测试 java代码
最新推荐文章于 2024-06-04 17:42:39 发布