I have already tested once, but great thanks, i didn't expect results at all. 4 Check variant failed in every type (x>0 y>0; x<0 y>0; x<0 y<0; x>0 y<0;)
pawn Code:
#include <a_samp>
//#define CODE_1 printf("%d", 42);
//#define CODE_2 new str[4]; format(str, sizeof (str), "%d", 42); print(str);
#define ITERATIONS (1000000)
public OnFilterScriptInit() Test();
Test()
{
new
t0,
t1,
t2,
i,j,
Float:x=0.3525,Float:y=0.5435431;
for (j = 0; j <10;j++)
{
t0 = GetTickCount();
for (i = 0; i < ITERATIONS; i++)
{
if(x*y>0) continue;
}
t1 = GetTickCount();
for (i = 0; i < ITERATIONS; i++)
{
if(x>0 && y>0) continue;
else if(x<0 && y<0) continue;
}
t2 = GetTickCount();
printf("Time 1: %04d, time 2: %04d", t1 - t0, t2 - t1);
}
}
X*Y>0 was 200ms faster :O.
Sorry for my mistakes, i'm dealing with quite problematic code right now, which could change a lot. Only problem - i'm not going to let noobs to handle it. Really only compiled special clause scripts will be relesed for everyone.
Test result continue.. even more wierd :
pawn Code:
if(Prev_X<x) Dir=floatround(Float:y,floatround_ceil)+1;
Faster than :
pawn Code:
if(Prev_X<x) if(y>0) Dir=false; else Dir=true;