18.11.2012, 10:25
Quote:
lol. do you know about benchmarking? so do its yourself.
I never says anything without a reason/proof. Normal condition: 10760068 MS Ternary condition: 10955372 MS Код:
... |
Trys this:
pawn Код:
main()
{
new start, StartTick, StopTick;
start = GetTickCount();
for(new i; i < 1000000; i ++)
{
StartTick = (StartTick == 1) ? 0 : 1;
StartTick = (StartTick == 1) ? 0 : 1;
StartTick = (StartTick == 1) ? 0 : 1;
StartTick = (StartTick == 1) ? 0 : 1;
StartTick = (StartTick == 1) ? 0 : 1;
}
StopTick = GetTickCount();
printf("Ternary condition: %d MS", StopTick - start);
start = GetTickCount();
for(new i; i < 1000000; i ++)
{
if(StartTick == 1)
{
StartTick = 0;
}
else
{
StartTick = 1;
}
if(StartTick == 1)
{
StartTick = 0;
}
else
{
StartTick = 1;
}
if(StartTick == 1)
{
StartTick = 0;
}
else
{
StartTick = 1;
}
if(StartTick == 1)
{
StartTick = 0;
}
else
{
StartTick = 1;
}
if(StartTick == 1)
{
StartTick = 0;
}
else
{
StartTick = 1;
}
}
StopTick = GetTickCount();
printf("Normal condition: %d MS", StopTick - start);
}
[18/11/2012 08:44:14] Ternary condition: 133 MS
[18/11/2012 08:44:14] Normal condition: 159 MS