public static void Main(string[] args) { Stopwatch sw = new Stopwatch(); //程序计时器 StringBuilder str = new StringBuilder(); sw.Start(); for(int i=0 ;i<40000;i++) { str.Append(i); } str.ToString() Console.WriteLine(sw.Elapsed); Console.ReadKey(); }