// Collection of code snippets by Arne Vajhøj // posted to eksperten.dk, usenet and other places (2002-now) using System; using System.Collections.Generic; public class N2 { public static void Main(string[] args) { DateTime dt1 = DateTime.Now; Dictionary hashtable = new Dictionary(); for(int i = 1; i <= 10000000; ++i) { double x = i; hashtable.Add(x, 1.0 / x); } DateTime dt2 = DateTime.Now; Console.WriteLine("hashtable(100.0) = " + hashtable[100.0]); Console.WriteLine((dt2 - dt1).TotalSeconds); } }