[Ajuda] PVAR
#4

Й um Bench simples, mas mostra que a PVar leva o dobro do tempo de uma variбvel normal...

Код:
#include a_samp

main()
{
    new getVal = 0;
    new myVar[1];
    new a, b;
    
    // -- PVars
    b = GetTickCount();
    for(new i = 0; i < 100000; i ++)
    {
        SetPVarInt(0, "myPVar", 100);
    }
    a = GetTickCount();
    printf("SetPVarInt: %ims", a-b);

    b = GetTickCount();
    for(new i = 0; i < 100000; i ++)
    {
        getVal = GetPVarInt(0, "myPVar");
    }
    a = GetTickCount();
    printf("GetPVarInt: %ims", a-b);

    // -- Vars
    b = GetTickCount();
    for(new i = 0; i < 100000; i ++)
    {
        myVar[0] = 100;
    }
    a = GetTickCount();
    printf("Set myVar: %ims", a-b);

    b = GetTickCount();
    for(new i = 0; i < 100000; i ++)
    {
        getVal = myVar[0];
    }
    a = GetTickCount();
    printf("Get myVar: %ims", a-b);
}
Output:
Quote:

SetPVarInt: 13ms
GetPVarInt: 12ms
Set myVar: 6ms
Get myVar: 5ms

Reply


Messages In This Thread
PVAR - by EmerZZeT - 26.07.2018, 03:21
Re: PVAR - by EmerZZeT - 26.07.2018, 18:24
Re: PVAR - by InsaneBR - 26.07.2018, 18:42
Re: PVAR - by F1N4L - 26.07.2018, 19:07
Re: PVAR - by rjjj - 27.07.2018, 16:40
Re: PVAR - by Bruno13 - 28.07.2018, 00:42
Re: PVAR - by bruxo00 - 28.07.2018, 12:26

Forum Jump:


Users browsing this thread: 1 Guest(s)