03.08.2012, 10:15
Quote:
Speed differences ? Can this be taken into for optimizations ?
|
pawn Код:
main()
{
new str[2048],f;
for(new i = 0;i<2048;++i) str[i] = random(90-65)+65;
new stime,ftime,loc;
stime = GetTickCount();
for(new i=0;i<10000000;++i)
{
f=random(90-65)+65;
loc = strfind1(str,f);
}
ftime = GetTickCount();
printf("strfind1 took %d ",ftime-stime);
stime = GetTickCount();
for(new i=0;i<10000000;++i)
{
f=random(90-65)+65;
loc = strfind1(str,f);
}
ftime = GetTickCount();
printf("strfind took %d ",ftime-stime);
}
Код:
[15:55:34] strfind1 took 28715 [15:56:03] strfind took 28718