M
menzhe
Unregistered / Unconfirmed
GUEST, unregistred user!
program Proj29;
{$APPTYPE CONSOLE}
uses
SysUtils,windows;
procedure swapa;
var
s:cardinal;
begin
asm mov ecx ,100000000
xor eax,eax
@s: add eax,1
loop @s
mov s,eax
end;
writeln(s);
end;
procedure swapb;
var i,tmp:cardinal;
begin
i:=0;
for tmp:=1 to 100000000 do i:=i+1;
writeln(i);
end;
var s,a,m,n:cardinal;
begin
s:=gettickcount;
swapa ;
a:=gettickcount-s;
writeln(a);
m:=gettickcount;
swapb ;
n:=gettickcount-m;
writeln;
{ TODO -oUser -cConsole Main : Insert code here }
end.
运行结果swapa:952
swapb:320
我的机器是赛杨633。
{$APPTYPE CONSOLE}
uses
SysUtils,windows;
procedure swapa;
var
s:cardinal;
begin
asm mov ecx ,100000000
xor eax,eax
@s: add eax,1
loop @s
mov s,eax
end;
writeln(s);
end;
procedure swapb;
var i,tmp:cardinal;
begin
i:=0;
for tmp:=1 to 100000000 do i:=i+1;
writeln(i);
end;
var s,a,m,n:cardinal;
begin
s:=gettickcount;
swapa ;
a:=gettickcount-s;
writeln(a);
m:=gettickcount;
swapb ;
n:=gettickcount-m;
writeln;
{ TODO -oUser -cConsole Main : Insert code here }
end.
运行结果swapa:952
swapb:320
我的机器是赛杨633。