I have several processes in which I use System.Random's default constructor to generate random numbers. I read about it on MSDN but it dosn't say the specific system clock resolution it uses, for example does System.Random get the system clock seed in ms or seconds? Is it safe to use the default constructor across several process to get random values between them?
Cheers
it's uses the Environment.TickCount
you can check it in Reflector.
But the point is to get an unique seed, so you can use an arithmetic operation on this value with the ProcessID . like:
Random(Environment.TickCount + System.Diagnostics.Process.GetCurrentProcess().Id);
etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With