26.11.2012, 14:53
Muchas gracias en verdad las arrays son mas rapidas, aunque se llevan poco en diferencia.
Test:
Test:
pawn Код:
#include <a_samp>
#undef MAX_PLAYERS
#define MAX_PLAYERS (1000000)
enum pData
{
array,
};
new PlayerInfo[MAX_PLAYERS][pData];
public OnFilterScriptInit()
{
//==========================================================================
new
dCount = GetTickCount();
for(new i; i < MAX_PLAYERS; ++i)
{
PlayerInfo[i][array] = 1;
}
printf("[Array] Funciуn: %d - Tiempo: %d", MAX_PLAYERS,(GetTickCount() - dCount));
//==========================================================================
new
bCount = GetTickCount();
for(new i; i < MAX_PLAYERS; ++i)
{
SetPVarInt(i, "array", 1);
}
printf("[PVars] Funciуn: %d - Tiempo: %d", MAX_PLAYERS,(GetTickCount() - bCount));
//==========================================================================
return true;
}