Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.21 KB | None | 0 0
  1. #include <a_samp>
  2. #include <mbits>
  3. #include <bitfunctions>
  4. #include <rbits>
  5.  
  6. public OnFilterScriptInit()
  7. {
  8.     new tick, vara, varb;
  9.     new Bit1:varc<32>;
  10.    
  11.     new bool:vard[32];
  12.    
  13.     tick = GetTickCount();
  14.  
  15.     for(new i; i < 1000000; i++)
  16.     {
  17.         SetValueBit(vara, 1, 1);
  18.         SetValueBit(vara, 2, 0);
  19.         if(!GetValueBit(vara, 2))
  20.         {
  21.             SetValueBit(vara, 1, 0);
  22.             SetValueBit(vara, 2, 1);
  23.         }
  24.     }
  25.     printf("BitFunctions: %dms", GetTickCount() - tick);
  26.  
  27.     tick = GetTickCount();
  28.  
  29.     for(new i; i < 1000000; i++)
  30.     {
  31.         SetBitTrue(varb, BIT_VAR_1);
  32.         SetBitFalse(varb, BIT_VAR_2);
  33.         if(!IsBit(varb, BIT_VAR_2))
  34.         {
  35.             SetBitFalse(varb, BIT_VAR_1);
  36.             SetBitTrue(varb, BIT_VAR_2);
  37.         }
  38.     }
  39.     printf("mBits: %dms", GetTickCount() - tick);
  40.    
  41.     tick = GetTickCount();
  42.  
  43.     for(new i; i < 1000000; i++)
  44.     {
  45.         Bit1_Set(varc, 1, 1);
  46.         Bit1_Set(varc, 2, 0);
  47.         if(!Bit1_Get(varc, 2))
  48.         {
  49.             Bit1_Set(varc, 1, 0);
  50.             Bit1_Set(varc, 2, 1);
  51.         }
  52.     }
  53.     printf("rBits: %dms", GetTickCount() - tick);
  54.  
  55.     tick = GetTickCount();
  56.     for(new i; i < 1000000; i++)
  57.     {
  58.         vard[1] = true;
  59.         vard[2] = false;
  60.         if(!vard[2])
  61.         {
  62.             vard[1] = false;
  63.             vard[2] = true;     }
  64.     }
  65.     printf("Booleans: %dms", GetTickCount() - tick);
  66.     return 1;
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement