摘要:
在调试中,经常需要计算某一段代码的执行时间,下面给出两种常用的方式: 第一种:使用GetTickCount函数#include<iostream> #include<windows.h> int main() { DWORD start_time=GetTickCount(); { //此处为被测试代码 } DWORD end_time=GetTickCount(); cout<<"The run time is:"<<(end_time-start_time)<<"ms!"<<en 阅读全文