Guest User

Untitled

a guest
Jan 22nd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.66 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define MAX_LOOPS 1000000
  4.  
  5. main() { }
  6.  
  7. public OnGameModeInit()
  8. {
  9.     new
  10.         i=0,k=0,
  11.         x[4];
  12.     x[0] = GetTickCount();
  13.     for( i = 0 ; i != MAX_LOOPS ; i++)
  14.     {
  15.         k=0;
  16.         while(k!=MAX_PLAYERS)
  17.         {
  18.             k++;
  19.         }
  20.     }
  21.     x[1] = GetTickCount();
  22.     for( i = 0 ; i != MAX_LOOPS ; i++)
  23.     {
  24.         for( k=0 ; k !=MAX_PLAYERS;k++)
  25.         {
  26.             k++;
  27.         }
  28.     }
  29.     x[2] = GetTickCount();
  30.     for( i = 0 ; i != MAX_LOOPS ; i++)
  31.     {
  32.         k=0;
  33.         do
  34.         {
  35.             k++;
  36.         }
  37.         while(k!=MAX_PLAYERS);
  38.     }
  39.     x[3] = GetTickCount();
  40.     printf(" while Loop %04dms", x[1] - x[0] );
  41.     printf(" for Loop %04dms", x[2] - x[1] );
  42.     printf(" do while %04dms", x[3] - x[2] );
  43.     return 1;
  44. }
Add Comment
Please, Sign In to add comment