代码
Stopwatch watch = new Stopwatch();
watch.Start();
ArrayList al = new ArrayList();
for (long i = 0; i < 1000000; i++)
{
al.Add(i);
}
watch.Stop();
Console.WriteLine(watch.ElapsedMilliseconds);
watch.Reset();
watch.Start();
List<int> list = new List<int>();
for (int i = 0; i < 1000000; i++)
{
list.Add(i);
}
watch.Stop();
Console.WriteLine(watch.ElapsedMilliseconds);