static void Main(string[] args) { Stopwatch sw = new Stopwatch(); SqlCommandParamQueryPerformanceMonitor monitor = new SqlCommandParamQueryPerformanceMonitor(Configuration.SqlConnectionString); var dbManager = new SqlDatabaseManager(Configuration.SqlConnectionString); dbManager.DeleteAll(); int id = 0; foreach (var count in new[] { 4, 4, 16, 128, 256, 512, 1000 }) //new[] { 10, 128, 1000, 10000 } { // int count = 1000; for (int i = 0; i < count; i++) monitor.Insert(new Department { Id = ++id, DateAdded = DateTime.Now, Name = "dep " + i }, sw); sw.Stop(); Console.WriteLine(((double)sw.ElapsedTicks / (double)System.Diagnostics.Stopwatch.Frequency) * 1000); } Console.ReadLine(); }
static void Main(string[] args) { Stopwatch sw = new Stopwatch(); SqlCommandParamQueryPerformanceMonitor monitor = new SqlCommandParamQueryPerformanceMonitor(Configuration.SqlConnectionString); var dbManager = new SqlDatabaseManager(Configuration.SqlConnectionString); dbManager.DeleteAll(); int id = 0; foreach (var count in new[] { 4, 4, 16, 128, 256, 512, 1000 }) //new[] { 10, 128, 1000, 10000 } { // int count = 1000; for (int i = 0; i < count; i++) { monitor.Insert(new Department { Id = ++id, DateAdded = DateTime.Now, Name = "dep " + i }, sw); } sw.Stop(); Console.WriteLine(((double)sw.ElapsedTicks / (double)System.Diagnostics.Stopwatch.Frequency) * 1000); } Console.ReadLine(); }