using System;
using System
namespace ConsoleApplication
{
class Program
{
private const int loopTimes =
static void Main(string[] args)
{
string str = string
string str
StringBuilder sb = new StringBuilder();
DateTime timeStart = DateTime
for (int i =
{
str += i
str += i
str += i
}
Console
timeStart = DateTime
for (int i =
{
str
}
Console
timeStart = DateTime
for (int i =
{
sb
sb
sb
}
Console
}
}
} 字符串直接做加法運行
字符串直接做加法運行
從上面的兩次循環可以看出來
字符串直接做加法
看了上面稍微業余點的說明
結論:如果是少量的加法運算
From:http://tw.wingwit.com/Article/program/net/201311/12210.html