public static void DoMemoryTest(ITestBiz obj, int times) //500000 { for (int i = 0; i < times; i++) { obj.AddOne(); } MessageBox.Show("Take the snapshot"); obj.Clear(); return; }
public static TimeSpan DoSpeedTest(ITestBiz obj, int times) //1000000 { DateTime d1 = DateTime.Now; for (int i = 0; i < times; i++) { obj.AddOne(); obj.DeleteOne(); } for (int j = 0; j < 1000; j++) // 1000 { for (int i = 0; i < 10000; i++) { obj.AddOne(); } obj.Clear(); } DateTime d2 = DateTime.Now; return(d2 - d1); }