标签:blog http strong 2014 cti for
Measure-Command { $ar = @() for ($x=0; $x -lt 10000; $x++) { $ar += $x } }
执行结果:3.301s
Measure-Command {
$ar = New-Object -TypeName System.Collections.ArrayList
for ($x=0; $x -lt 10000; $x++)
{
$ar.Add($x)
}
}
执行结果:0.047s
From:http://powershell.com/cs/blogs/tips/archive/2014/06/23/speeding-up-arrays.aspx
标签:blog http strong 2014 cti for
原文地址:http://www.cnblogs.com/dreamer-fish/p/3817813.html