谁能一句句的解释一下这串代码是什么意思?
#include<iostream>#include<ctime>usingnamespacestd;intmain(){clock_tstartTime,endTime...
#include<iostream>
#include<ctime>
using namespace std;
int main()
{
clock_t startTime,endTime;
for (int i = 0; i < 2147483640; i++)
{
i++;
}
startTime = clock();//计时开始
for ( i = 0; i < 2147483640; i++)
{
i++;
}
endTime = clock();//计时结束
cout << "运行时间是:" <<(double)(endTime - startTime) / CLOCKS_PER_SEC << "s" << endl;
cout << "运行时间是:" << (double)clock() /CLOCKS_PER_SEC<< "s" << endl;
system("pause");
return 0; 展开
#include<ctime>
using namespace std;
int main()
{
clock_t startTime,endTime;
for (int i = 0; i < 2147483640; i++)
{
i++;
}
startTime = clock();//计时开始
for ( i = 0; i < 2147483640; i++)
{
i++;
}
endTime = clock();//计时结束
cout << "运行时间是:" <<(double)(endTime - startTime) / CLOCKS_PER_SEC << "s" << endl;
cout << "运行时间是:" << (double)clock() /CLOCKS_PER_SEC<< "s" << endl;
system("pause");
return 0; 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询