I generate a lot of random numbers, and I need a nice function, as this doesn't help much:
public static class Randomizer
{
static Random random = new Random((int)DateTime.Now.Ticks);
public static int RandomInteger(int minimum, int maximum)
{
return random.Next(minimum, maximum + 1);
}
public static double RandomDouble()
{
return random.NextDouble();
}
}
When I use this class, my numbers very often coincide. Do you have any simple idea on how I can improve randomizer performance?
Thank you Ivan
source
share