27.06.2011, 16:24
pawn Code:
for (new i = 0; i < 500; ++i)
{
new
t,
string [256] = "AffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffe",
string2 [256];
const MAX_I = 20000;
t = GetTickCount ();
for (new k = 0; k < MAX_I; ++k)
{
string = "AffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffe";
string2 = strreplace ("Affe", "Kuh", string);
}
t = GetTickCount () - t;
printf ("strreplace: %d ms (%s)", t, string2);
t = GetTickCount ();
for (new k = 0; k < MAX_I; ++k)
{
string = "AffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffe";
str_replace ("Kuh", "Affe", string, string2);
}
t = GetTickCount () - t;
printf ("str_replace: %d ms (%s)", t, string2);
t = GetTickCount ();
for (new k = 0; k < MAX_I; ++k)
{
string = "AffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffe";
strreplace2 (string, "Affe", "Kuh");
}
t = GetTickCount () - t;
printf ("strreplace2: %d ms (%s)", t, string);
t = GetTickCount ();
for (new k = 0; k < MAX_I; ++k)
{
string = "AffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffeAffe";
strReplace ("Affe", "Kuh", string, string2);
}
t = GetTickCount () - t;
printf ("strReplace: %d ms (%s)", t, string2);
}
Code:
[18:27:23] strreplace: 8077 ms (KuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuh) [18:27:24] str_replace: 382 ms (KuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuh) [18:27:24] strreplace2: 543 ms (KuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuh) [18:27:25] strReplace: 484 ms (KuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuh) [18:27:33] strreplace: 8032 ms (KuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuh) [18:27:33] str_replace: 386 ms (KuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuh) [18:27:34] strreplace2: 543 ms (KuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuh) [18:27:34] strReplace: 483 ms (KuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuh) [18:27:42] strreplace: 8023 ms (KuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuh) [18:27:43] str_replace: 381 ms (KuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuh) [18:27:43] strreplace2: 544 ms (KuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuh) [18:27:44] strReplace: 489 ms (KuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuhKuh)