Code:
Public Class TestObject
Public Property RandomNumber As Integer
Private rand As Random
Public Sub New()
rand = New Random
Me.RandomNumber = rand.Next(0, 10000)
End Sub
End Class
P.S. I know this seems like a small, insignificant issue, but my program actually won't be able to work unless I figure this out..
EDIT: Do I seriously have to pause thread execution for 1 millisecond to make sure the initial seed value is different each time is a test object is created? And in a background thread so that is doesn't pause the UI thread? That's ridiculous just to generate a list of random numbers...
EDIT 2: I just tested pausing execution for 10 milliseconds between creating each object in a loop. Some numbers are still repeating, but it isn't nearly as bad as without the pausing. This is unacceptable though because it takes to long to create a large list with the pause. Also I can't have repeating numbers.