Imports System.Text Module Module1 Public Sub Main() 'Run the test 10 times Dim lnI As Integer For lnI = 1 To 10 TestIt() Next 'Add a break Console.ReadLine() End Sub Public Sub TestIt() Dim tStart As DateTime = DateTime.Now Dim SB As New StringBuilder() Dim i As Integer = 1 While i <> 30000 SB.Append("Hi" + i.ToString()) SB.Append(" blah blahblah blahblah blahblah blahblah blahblah blah ") i = i + 1 End While Console.WriteLine(DateTime.Now.Subtract(tStart)) End Sub 'Results: '00:00:00.3204608 '00:00:00.2703888 '00:00:00.2403456 '00:00:00.2403456 '00:00:00.2503600 '00:00:00.2403456 '00:00:00.2503600 '00:00:00.2403456 '00:00:00.2503600 '00:00:00.2403456 End ModuleTest results for C#
using System; using System.Text; namespace CSharpSpeedTest { /// <summary> /// Summary description for Class1. /// </summary> class Class1 { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main(string[] args) { for(int i = 0; i < 10; i++) PrintIt(); //Add a break Console.ReadLine(); } static void PrintIt() { DateTime tStart = DateTime.Now; StringBuilder SB = new StringBuilder(); int i=1; while (i != 30000) { SB.Append("Hi"+i.ToString()); SB.Append(" blah blahblah blahblah blahblah blahblah blahblah blah "); i++; } Console.WriteLine(DateTime.Now.Subtract(tStart)); } //Results // 00:00:00.3304752 // 00:00:00.2503600 // 00:00:00.2503600 // 00:00:00.2403456 // 00:00:00.2603744 // 00:00:00.2403456 // 00:00:00.2503600 // 00:00:00.2403456 // 00:00:00.2503600 // 00:00:00.2403456 } }Kamal