static void Main(string[] args) { worker(); #if false using (var mt = new Prng(PrngKind.MersenneTwister19937_32)) { byte[] seed = new byte[] { 0x01, 0x23, 0x02, 0x34, 0x03, 0x45, 0x04, 0x56 }; mt.SetSeed(seed); for (int i = 0; i < 64; ++i) Console.WriteLine("{0}", (uint)mt.GetInt()); } #endif }
public double Run() { byte[] seed = new byte[] { 0x01, 0x23, 0x02, 0x34, 0x03, 0x45, 0x04, 0x56 }; PerfWatch t = new PerfWatch(); byte[] output = new byte[megabytes * 1048576]; t.Start(); t.Stop(); using (Prng prng = new Prng(Prng)) { prng.SetSeed(seed); prng.Update(output); prng.SetSeed(seed); GC.Collect(); t.Start(); prng.Update(output); t.Stop(); } GC.Collect(); return megabytes / t.seconds(); }