参考博客:https://blog.csdn.net/u013390476/article/details/50209603
C++计时
#include<ctime>//用万能头文件也行
#include<iostream>
using namespace std;
int main()
{
clock_t start = clock();
int a=0;
for(int i=1;i<=400000000;i++) //4e8
a++;
clock_t end = clock();
cout << "花费了" << (double)(end - start) / CLOCKS_PER_SEC << "秒" << endl;
return 0;
}