Vlad-00003

Untitled

May 12th, 2021
508
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. using System.Diagnostics;
  3. class EmptyPlugin : RustPlugin
  4.     {
  5.         public BaseEntity[] _buffer = new BaseEntity[10000];
  6.         [ChatCommand("test")]
  7.         private void testCmd(BasePlayer player, string command, string[] args)
  8.         {
  9.             var list = Facepunch.Pool.GetList<BaseEntity>();
  10.             var sw = Stopwatch.StartNew();
  11.             var inSphere =  BaseEntity.Query.Server.GetInSphere(player.ServerPosition, 100f, _buffer);
  12.             sw.Stop();
  13.             PrintWarning("METHOD 1: Found {0} object, took {1}ms",inSphere,sw.ElapsedMilliseconds);
  14.             sw.Restart();
  15.             Vis.Entities(player.ServerPosition, 100f, list);
  16.             sw.Stop();
  17.             PrintWarning("METHOD 2: Found {0} object, took {1}ms", list.Count, sw.ElapsedMilliseconds);
  18.             Facepunch.Pool.FreeList(ref list);
  19.         }
  20.     }
RAW Paste Data