14.02.2014, 05:20
Today I learned that
is faster than
Test1 took 691ms and Test2 took 741ms
Test1 took 708ms and Test2 took 719ms
Test1 took 678ms and Test2 took 703ms
Tested @ http://slice-vps.nl:7070/
Try multiple times because sometimes the Test 2 comes faster but the experimental probability that I calculated is Test Two comes faster every 6 times Test 1 comes faster.
To be sure which ones faster ,I need to see the Assembly code.
Code:
if() else
Code:
if() return or continue or whatever some code to handle else
Code:
#include <a_samp> #include <ppg> #define EQUALTO(%0,%1) (!(%0 ^ %1)) #define ITER 10000000 main() { new a = 15; new test1s,test2s,test1e,test2e; test1s = GetTickCount(); for(new i = ITER;i > 0;i--) { if(a == 45) { continue; } else { continue; } } test1e = test2s = GetTickCount(); for(new i = ITER;i > 0;i--) { if(a == 45) { continue; } continue; } test2e = GetTickCount(); printf("Test1 took %dms and Test2 took %dms",test1e-test1s,test2e-test2s); }
Test1 took 708ms and Test2 took 719ms
Test1 took 678ms and Test2 took 703ms
Tested @ http://slice-vps.nl:7070/
Try multiple times because sometimes the Test 2 comes faster but the experimental probability that I calculated is Test Two comes faster every 6 times Test 1 comes faster.
To be sure which ones faster ,I need to see the Assembly code.