SA-MP Forums Archive
I need some help with speed of codes - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: I need some help with speed of codes (/showthread.php?tid=154793)



I need some help with speed of codes - Mark k - 15.06.2010

hi people,
i need some help with speed of codes, i don't know much about this but i really want to learn.
By speed of code I mean which code(loop) will go faster, which would go slower and for example which one will lag your game more.
so anyone got any tut.?
Thanks :P


Re: I need some help with speed of codes - RyDeR` - 15.06.2010

I tested some weeks ago and while loop was slower than for loop.

pawn Код:
new
    i
;
while(i != MAX_PLAYERS)
{
    // Your code inside the loop
    i++;
}
pawn Код:
for(new i; i != MAX_PLAYERS; i++)
{
    // Your code inside the loop
}