Global Array or PVars
#9

I did a test and I found that Normal Variables are faster than PVars.
pawn Код:
#include <a_samp>

#define ITTERATIONS  10000000

main()
{
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}


public OnGameModeInit()
{
    new tick1,tick2;
    new playerid, Variable[MAX_PLAYERS];
    tick1 = tickcount();
    for(new i;i<ITTERATIONS;i++){
        if(Variable[playerid] == 0) continue;
    }
    printf("Normal Variable: %d", tickcount()-tick1);
    tick2 = tickcount();
    for(new i;i<ITTERATIONS;i++){
        if(GetPVarInt(playerid, "testing") == 0) continue;
    }
    printf("Per-Player Variable: %d", tickcount()-tick2);
    return 1;
}
Reply


Messages In This Thread
Global Array or PVars - by anonymousx - 25.01.2011, 23:35
Re: Global Array or PVars - by Not available - 25.01.2011, 23:36
Re: Global Array or PVars - by Grim_ - 25.01.2011, 23:36
Re: Global Array or PVars - by iggy1 - 25.01.2011, 23:37
Re: Global Array or PVars - by Calgon - 25.01.2011, 23:38
Re: Global Array or PVars - by The_Moddler - 25.01.2011, 23:39
Re: Global Array or PVars - by [L3th4l] - 25.01.2011, 23:52
Re: Global Array or PVars - by Calgon - 25.01.2011, 23:55
Respuesta: Global Array or PVars - by anonymousx - 15.02.2011, 00:56
Re: Global Array or PVars - by Macluawn - 15.02.2011, 05:35

Forum Jump:


Users browsing this thread: 2 Guest(s)