Advertisement
YashasSamaga

PAWN - Loop Condtitions matter

Jul 4th, 2015
1,041
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.47 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. new maxp = 100;
  4. stock func()
  5. {
  6.     return maxp;
  7. }
  8. main()
  9. {
  10.     for(new j = 0;j < 5;j++)
  11.     {
  12.         new a = GetTickCount();
  13.         for(new i = 0;i < 1000000;i++)
  14.         {
  15.             for(new i = 0,j = func(); i < j;i++) {}
  16.         }
  17.         new b = GetTickCount();
  18.         printf("Speed Test %d",b-a);
  19.        
  20.         a = GetTickCount();
  21.         for(new i = 0;i < 1000000;i++)
  22.         {
  23.             for(new i = 0; i < func();i++) {}
  24.         }
  25.         b = GetTickCount();
  26.         printf("Speed Test %d \n\n",b-a);
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement