for (j=0; j< LoopTimes; j++)
{
__intel_new_memset(lpByte,1,SIZE);
}
dwTime1 = GetTickCount() - dwStart;
//MS crt version
dwStart = GetTickCount();
for (j=0; j< LoopTimes; j++)
{
memset(lpByte,1,SIZE);
//ZeroMemory(lpByte,SIZE);
}
dwTime2 = GetTickCount() - dwStart;
//delete []lpByte;
printf("Intel=%dms MSC=%dms\n",dwTime1,dwTime2);
}
int main(int argc, char* argv[])
{
#define THREADS 2
HANDLE hThread[THREADS]; //array to hold thread handle
LPBYTE lpByte[THREADS]; //Array to hold thread-specific memory
int i;
//Count mem alloc time. Debug version is very long
DWORD dwStart = GetTickCount();
for (i=0; i |
正在阅读:精彩教程:快速初始化内存(1)精彩教程:快速初始化内存(1)
2004-05-20 10:13
出处:CSDN
责任编辑:linjixiong
键盘也能翻页,试试“← →”键