在程序中安插计算程序运行时间的函数
在程序中插入计算程序运行时间的函数
怎么看这个程序运行了多长时间出界?
------解决方案--------------------
前系统的毫秒,GetTickCount();
int main()
{
int i=1;
while(i++);
cout<<"over ";
return 0;
}
怎么看这个程序运行了多长时间出界?
------解决方案--------------------
前系统的毫秒,GetTickCount();
DWORD d1 = GetTickCount();
int i=1;
while(i++);
DWORD d2 = GetTickCount();
cout<<"over " << d2-d1<< endl;