Possible Duplicate:
Random number generator only generating one random number
class System.Random .. why not static?
I have a public static class called RandomGenerator
which only has one value a public static random = new Random();
This is what it looks like
public static class RandomGenerator
{
public static Random random = new Random();
}
I had to do this because when my code went to access a random it would generate too many duplicate copies (I believe it had something to do with the location of Random in memory)
The above code works great! My code generates a truly random value each time it's called. My question is why isn't random a built in static function of the C# language? Is it because accessing something this way will result in a performance hit? Are there any notable performance issues with the way i've written my code?