Quote:
Originally Posted by oOFotherOo
Muchas gracias en verdad las arrays son mas rapidas, aunque se llevan poco en diferencia.
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; }
|
se llevan poco en diferencia (ni se si de esa manera se estaria comprobando bien) pero me tarda mбs el array