Advertisement
Guest User

Untitled

a guest
Oct 14th, 2011
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.65 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.         }
  27.     }
  28.     x[2] = GetTickCount();
  29.     for( i = 0 ; i != MAX_LOOPS ; i++)
  30.     {
  31.         k=0;
  32.         do
  33.         {
  34.             k++;
  35.         }
  36.         while(k!=MAX_PLAYERS);
  37.     }
  38.     x[3] = GetTickCount();
  39.     printf(" while Loop %04dms", x[1] - x[0] );
  40.     printf(" for Loop %04dms", x[2] - x[1] );
  41.     printf(" do while %04dms", x[3] - x[2] );
  42.     return 1;
  43. }
  44.  
  45.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement