I have a loop of VB6 code which executes 1,000,000 plus times. Each time the loop is executed a 32 bit random number is generated. Processing time for each loop is about 250 loops per second. Problem is I am ending up with about 30,000 duplicate numbers. My understanding is that the Rnd
function uses the system elapsed milliseconds from system start. That should mean that the system "seed" has changed with each loop, but still getting duplicates.
Example:
for i = 1 to 1000000
'do a bunch of code
'get a 32 bit random number using Rnd twice in a function with
'a Randomize statement before each Rnd
'do another bunch of code
next i
Any ideas?
Thanks