HSN Posted April 11, 2005 Posted April 11, 2005 I'm using the System.Random of C# to generate some random numbers. In order to make the seed vary for each execution of the code, I wanna use the CPU time as a seed number so it would make real random numbers. However, I don't know how do I get the time of the CPU in C#?! Please help me with that.. Quote
Leaders snarfblam Posted April 11, 2005 Leaders Posted April 11, 2005 Instantiate the System.Random class using the default constructor (no parameters). It will use the system's time as the seed. Quote [sIGPIC]e[/sIGPIC]
HSN Posted April 11, 2005 Author Posted April 11, 2005 Instantiate the System.Random class using the default constructor (no parameters). It will use the system's time as the seed. Ok good, that works. But anyway how can I get the system's time? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.