Imports System.Text
public class Test
public Shared Sub Main
Const ADD_STRING As String = "1234567890"
Dim num_trials As Long = 1000
Dim start_time As DateTime
Dim stop_time As DateTime
Dim elapsed_time As TimeSpan
Dim txt As String
Dim string_builder As New StringBuilder
txt = ""
start_time = Now
For i As Long = 1 To num_trials
txt = txt & ADD_STRING
Next i
stop_time = Now
elapsed_time = stop_time.Subtract(start_time)
Console.WriteLine(elapsed_time.TotalSeconds.ToString("0.000000"))
txt = ""
start_time = Now
For i As Long = 1 To num_trials
string_builder.Append(ADD_STRING)
Next i
txt = string_builder.ToString()
stop_time = Now
elapsed_time = stop_time.Subtract(start_time)
Console.WriteLine(elapsed_time.TotalSeconds.ToString("0.000000"))
End Sub
End class
0.015625
0.000000