public void DirectTest() { Stopwatch sw = new Stopwatch(); sw.Start(); for (int i = 0; i < iterations; i++) { Customer c = new Customer(); } sw.Stop(); Console.WriteLine("DirectTest: " + (sw.ElapsedMilliseconds / (double) iterations)); }
private object ProduceCustomer() { Customer customer = new Customer(); _objectCount++; customer.FirstName = _testDataGen.RandomWord(); customer.LastName = _testDataGen.RandomWord(); customer.Age = _testDataGen.RandomInt(1, 100); customer.Phone = _testDataGen.RandomInt(1111111111, 1888888888).ToString(); customer.Ssn = _testDataGen.RandomInt(111111111, 999999999).ToString(); customer.Addresses.Add(ProduceAddress()); customer.Addresses[0].AddressType = 'B'; customer.Addresses[0].IsPrimary = true; customer.Addresses.Add(ProduceAddress()); customer.Addresses[1].AddressType = 'S'; while (_objectCount < _maxObjectCount) { Order ord = ProduceOrder(); customer.Orders.Add(ord); } return customer; }