fix: Fixes snooping staff (#900)
* Not allowed to snoop staff * Staff that snoop won't broadcast messages * Benchmarks RNG for double vs fixed int
This commit is contained in:
parent
dc6caf5766
commit
79dc9fa0f7
3 changed files with 88 additions and 66 deletions
28
Projects/Benchmarks/Benchmarks/Rng/BenchmarkDoubleVsFixed.cs
Normal file
28
Projects/Benchmarks/Benchmarks/Rng/BenchmarkDoubleVsFixed.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
using BenchmarkDotNet.Attributes;
|
||||
using BenchmarkDotNet.Jobs;
|
||||
using Server.Random;
|
||||
|
||||
namespace Benchmarks.Benchmarks.Rng
|
||||
{
|
||||
[MemoryDiagnoser]
|
||||
[SimpleJob(RuntimeMoniker.Net60)]
|
||||
public class BenchmarkDoubleVsFixed
|
||||
{
|
||||
private Xoshiro256PlusPlus _xoshiro256PlusPlus;
|
||||
|
||||
[GlobalSetup]
|
||||
public void Setup()
|
||||
{
|
||||
_xoshiro256PlusPlus = new Xoshiro256PlusPlus();
|
||||
}
|
||||
|
||||
[Benchmark]
|
||||
public bool NextDouble() => 50.1 < _xoshiro256PlusPlus.NextDouble() * 100;
|
||||
|
||||
[Benchmark]
|
||||
public bool NextFixedInt() => 501 < _xoshiro256PlusPlus.Next(1000);
|
||||
|
||||
[Benchmark]
|
||||
public bool NextHighResDouble() => 50.1 < _xoshiro256PlusPlus.NextDoubleHighRes() * 100;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue