16,473
社区成员
发帖
与我相关
我的任务
分享
DWORD dw1, dw2, dw3;
dw1 = GetTickCount();
CList<CPoint,CPoint&> listPoint;
for (int i = 0; i < 500000; i ++)
{
listPoint.AddTail(CPoint(i,i));
}
dw2 = GetTickCount();
listPoint.RemoveAll()
dw3 = GetTickCount();
TRACE(_T("T1=%ld T2=%ld\n"), dw2-dw1, dw3-dw2);
{
CArray<POINT,POINT&> listPoint;
listPoint.SetSize(500000);
DWORD dw1, dw2, dw3;
dw1 = GetTickCount();
for (int i = 0; i < 500000; i ++)
{
POINT pt ={i, i};
listPoint[i] = pt;
}
dw2 = GetTickCount();
listPoint.RemoveAll();
dw3 = GetTickCount();
TRACE(_T("T1=%ld T2=%ld\n"), dw2-dw1, dw3-dw2);
}