Public Class Tester
Public Shared Sub Main
Dim content As String = ""
Dim result As New System.Text.StringBuilder
Dim counter As Integer
Dim dateTime1 As Date
Dim dateTime2 As Date
Dim dateTime3 As Date
Dim loopCount As Integer = 15000
dateTime1 = Now
For counter = 1 To loopCount
content &= counter.ToString()
Next counter
dateTime2 = Now
For counter = 1 To loopCount
result.Append(counter.ToString())
Next counter
dateTime3 = Now
content = String.Format( _
"First loop took {0:G4} ms, the second took {1:G4} ms.", _
dateTime2.Subtract(dateTime1).TotalMilliseconds, _
dateTime3.Subtract(dateTime2).TotalMilliseconds)
Console.WriteLine(content)
End Sub
End Class
First loop took 1734 ms, the second took 0 ms.