Welcome 微信登录
编程资源 图片资源库 蚂蚁家优选 PDF转换器 软件资源

软件开发小程序制作系统集成与运维空间租用硬件开发视频监控技术咨询与支持——联系电话:0311-88999002/88999003

首页 / 操作系统 / Linux / CPU测试程序代码,Windows VS Linux

一直想估计一下自己的cpu每秒能大概运算多少次#include <time.h>
#include <iostream>
using namespace std;
int main(){
time_t one, two, three;
one=time(NULL);
two=time(NULL)+2;
three=time(NULL)+1;
int x=0;
while(two!=one) {
one=time(NULL);
if(three==one) x++;
}
cout<<x<<endl;
return 0;
}测试结果 amd 2000+ ddr400 512M Windows xp vc++6108万次左右 每秒赛扬400MHZ sdram pc100 128M linux mandrake8 gcc 2.9.6123万次左右 每秒结果很意外 难道400MHZ能跑过1.58GHZ的cpu,或者Linux比Windows强悍这么多?