A preserved archive of the Logical Gamers community forums, 2009-2025. The original threads and posts, served read-only. Registration, posting and private messages are gone for good.
What you are doing is "seeding" the RNG so that it creates an integer based on the current amount of milliseconds have passed since base date until now.
Basically the RNG will determine an integer randomly with an algorithm, we can add in the current milliseconds so that that result is based on the current time, meaning that in the next run it is impossible to have the same seed as used previously. Therefore making the algorithm a little more solid.
But seeding with time ( ) is no longer needed since version 4.2, srand will automatically be seeded with the time. Making it pointless to seed with time.