c# 计时器
using System; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; namespace cs_frist { class Program { static void Main(string[] args) { Stopwatch click = new Stopwatch(); click.Start(); //string str = string.Empty; //for(int i = 0;i < 10000; i++) //{ // str += i.ToString(); //} StringBuilder sb = new StringBuilder(); for (int i = 0; i < 10000; i++) { sb.Append(i.ToString()); } click.Stop(); Console.WriteLine(click.ElapsedMilliseconds); } } }

浙公网安备 33010602011771号