C++ 中有用的“计时器”

来源:岁月联盟 编辑:exp 时间:2012-09-12
头文件: #include<windows.h>
 
 DWORD dwStartTime = GetTickCount(); // 用dwStartTime记录起始时间
 
   ……………………  (程序段)
 www.2cto.com
cout<<"耗时"<<GetTickCount( )-dwStartTime<<"ms"<<endl;    //(输出编译器运行程序段时的时间)  
 
 
注:poj中不支持 #include<windows.h>
上一篇:POJ 1850 Code