H
HunterHua
Unregistered / Unconfirmed
GUEST, unregistred user!
我为了验证VC++6.0快,还是Delphi6快?,做了以下试验:
Delphi6代码为:
var
i,j: Integer;
t1,t2: DWord;
begin
t1 := GetTickCount();
for i := 0 to 999 do
begin
for j := 0 to 9 do
Edit1.Text := IntToStr(I);
Edit1.Refresh;
end;
t2 := GetTickCount() - t1;
Edit2.Text := IntToStr(t2);
VC6代码为:
int i;
int j;
DWORD t1,t2;
CEdit* pEdit;
CEdit* pEdit2;
pEdit = (CEdit*)(GetDlgItem(IDC_EDIT1));
pEdit2 = (CEdit*)(GetDlgItem(IDC_EDIT2));
t1 = GetTickCount();
for (i=0;i<1000;i++)
{
for (j=0;j<10;j++)
m_Show = i;
UpdateData(FALSE);
pEdit->UpdateWindow();
}
t2 = GetTickCount() - t1;
SetDlgItemInt(IDC_EDIT2,t2,TRUE);
pEdit2->UpdateWindow();
结果显示为vc需时832ms;D6需时1242ms;
该程序有无代表性,可否认为vc比delphi快得多?
Delphi6代码为:
var
i,j: Integer;
t1,t2: DWord;
begin
t1 := GetTickCount();
for i := 0 to 999 do
begin
for j := 0 to 9 do
Edit1.Text := IntToStr(I);
Edit1.Refresh;
end;
t2 := GetTickCount() - t1;
Edit2.Text := IntToStr(t2);
VC6代码为:
int i;
int j;
DWORD t1,t2;
CEdit* pEdit;
CEdit* pEdit2;
pEdit = (CEdit*)(GetDlgItem(IDC_EDIT1));
pEdit2 = (CEdit*)(GetDlgItem(IDC_EDIT2));
t1 = GetTickCount();
for (i=0;i<1000;i++)
{
for (j=0;j<10;j++)
m_Show = i;
UpdateData(FALSE);
pEdit->UpdateWindow();
}
t2 = GetTickCount() - t1;
SetDlgItemInt(IDC_EDIT2,t2,TRUE);
pEdit2->UpdateWindow();
结果显示为vc需时832ms;D6需时1242ms;
该程序有无代表性,可否认为vc比delphi快得多?