26.07.2018, 19:07
Й um Bench simples, mas mostra que a PVar leva o dobro do tempo de uma variбvel normal...
Output:
Код:
#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);
}
Quote:
|
SetPVarInt: 13ms GetPVarInt: 12ms Set myVar: 6ms Get myVar: 5ms |

