StopWatch
程序中为了计算使用时间,通常Stopwatchshi'y
Stopwatch watch = Stopwatch.StartNew(); using (RetailEntities context = new RetailEntities()) { foreach (var entity in customers) { context.Customers.Add(entity); } context.SaveChanges(); } watch.Stop(); Console.WriteLine(string.Format( "{0} customers are created, cost {1} milliseconds.", customerCount, watch.ElapsedMilliseconds));
本文来自博客园,作者:瘋孑,转载请注明原文链接:https://www.cnblogs.com/WebApp-DotNet/p/12187415.html