M
Martin Ho
This is the code I have so far, to generate 50.000 random numbers.
This code will generate the same sequence every time I run it. But the
problem being is that it's slow. It take on my p4 1.6gh almost 10
seconds to create 50.000 rundom numbers. This is just a 50k text in
other words.
Someone claimed in sciencegroups.com that he could create 100 milion
in 7 seconds on similar computer.
I need to speed this code somehow.
Could someone please look at it and help me to revise it?
Thanks a lot.
Sincerely,
Martin
Here is the code:
Private Const RAND_SEED As Integer = 123 ' Or anything
Private Const MAX_VALUE As Integer = 1000 ' This assumes single
digits
Private Sub Button1_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles Button1.Click
TextBox1.Text = ""
Button1.Visible = False
Dim numero As String
Dim r As New Random(RAND_SEED)
For i As Integer = 1 To 50000
numero += r.Next(MAX_VALUE).ToString
' StatusBar1.Text = i
Next i
TextBox1.Text = numero
Button1.Visible = True
End Sub
This code will generate the same sequence every time I run it. But the
problem being is that it's slow. It take on my p4 1.6gh almost 10
seconds to create 50.000 rundom numbers. This is just a 50k text in
other words.
Someone claimed in sciencegroups.com that he could create 100 milion
in 7 seconds on similar computer.
I need to speed this code somehow.
Could someone please look at it and help me to revise it?
Thanks a lot.
Sincerely,
Martin
Here is the code:
Private Const RAND_SEED As Integer = 123 ' Or anything
Private Const MAX_VALUE As Integer = 1000 ' This assumes single
digits
Private Sub Button1_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles Button1.Click
TextBox1.Text = ""
Button1.Visible = False
Dim numero As String
Dim r As New Random(RAND_SEED)
For i As Integer = 1 To 50000
numero += r.Next(MAX_VALUE).ToString
' StatusBar1.Text = i
Next i
TextBox1.Text = numero
Button1.Visible = True
End Sub