怎样才能测试程序在哪些代码上花费了多少时间? 有一种简单的方法,两个函数QueryPerformanceFrequency 和QueryPerformanceCounter,看看帮助,然后用它们框住你的代码。这样可以测出来 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 yes.其中QueryPerformanceFrequency 取得计数器频率,QueryPerformanceCounter返回计数器的计数值,计算程序耗时,只需要取得开始和结束时的计数除以计数频率就得到时间。 GetTickCount函数可以得到毫秒级的时间...#ifdef _DEBUG DWORD dwStartTime = ::GetTickCount();#endif // _DEBUG // 待测试的代码们 // ...#ifdef _DEBUG DWORD dwCount = ::GetTickCount() - dwStartTime; int nMMSenconds = dwCount / 1000; int nSenconds = dwCount / 1000; int nMinutes = nSenconds / 60; int nHours = nMinutes / 60; nMMSenconds = nMMSenconds % 1000; nSenconds = nSenconds % 60; nMinutes = nMinutes % 60; TRACE("这些操作共花费:\t%d小时%d分钟%d秒%d毫秒\n",nHours,nMinutes,nSenconds,nMMSenconds);#endif // _DEBUG 在工程设置的Link中选中Enable profiling,测试时,运行Build菜单下的Profile NUMEGA's software TrueTime for VC,VB 应该使用Queryperfor...函数系列,不过该函数可能只能在Win2000使用。 请问如何自己制作 返回上一步 的功能啊 100分!!!!!!!!!如何把位图显示在桌面上?谢谢! ADO的Recordset取数据时为什么取到一定的数目的记录后不再取了? 不知道怎么回事 链表clist问题 哪有读取gif、jpg文件并显示的源程序? 怎么读取ACCESS数据库里的OLE对象?(ADO) 那里有VC Asist 下载? 我在对话框上加了一个RichEdit,结果对话框就不能创建了,为什么呢? vs2003工程的一个问题。。。。 请教??msdn中的哪些部分是最基础的??哪些部分是最实用的?? 还是在VC中如何用OpenGL的简单问题!!!
DWORD dwStartTime = ::GetTickCount();
#endif // _DEBUG
// 待测试的代码们
// ...
#ifdef _DEBUG
DWORD dwCount = ::GetTickCount() - dwStartTime;
int nMMSenconds = dwCount / 1000;
int nSenconds = dwCount / 1000;
int nMinutes = nSenconds / 60;
int nHours = nMinutes / 60;
nMMSenconds = nMMSenconds % 1000;
nSenconds = nSenconds % 60;
nMinutes = nMinutes % 60;
TRACE("这些操作共花费:\t%d小时%d分钟%d秒%d毫秒\n",nHours,nMinutes,nSenconds,nMMSenconds);
#endif // _DEBUG