// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Collections; public class N1 { public static void Main(string[] args) { DateTime dt1 = DateTime.Now; Hashtable hashtable = new Hashtable(); 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); } }