Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.97 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.     tick = GetTickCount();
  12.  
  13.     for(new i; i < 1000000; i++)
  14.     {
  15.         SetValueBit(vara, 1, 1);
  16.         SetValueBit(vara, 2, 0);
  17.         if(!GetValueBit(vara, 2))
  18.         {
  19.             SetValueBit(vara, 1, 0);
  20.             SetValueBit(vara, 2, 1);
  21.         }
  22.     }
  23.     printf("BitFunctions: %dms", GetTickCount() - tick);
  24.  
  25.     tick = GetTickCount();
  26.  
  27.     for(new i; i < 1000000; i++)
  28.     {
  29.         SetBitTrue(varb, BIT_VAR_1);
  30.         SetBitFalse(varb, BIT_VAR_2);
  31.         if(!IsBit(varb, BIT_VAR_2))
  32.         {
  33.             SetBitFalse(varb, BIT_VAR_1);
  34.             SetBitTrue(varb, BIT_VAR_2);
  35.         }
  36.     }
  37.     printf("mBits: %dms", GetTickCount() - tick);
  38.    
  39.     tick = GetTickCount();
  40.  
  41.     for(new i; i < 1000000; i++)
  42.     {
  43.         Bit1_Set(varc, 1, 1);
  44.         Bit1_Set(varc, 2, 0);
  45.         if(!Bit1_Get(varc, 2))
  46.         {
  47.             Bit1_Set(varc, 1, 0);
  48.             Bit1_Set(varc, 2, 1);
  49.         }
  50.     }
  51.     printf("rBits: %dms", GetTickCount() - tick);
  52.     return 1;
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement