using System; using System.Diagnostics; namespace Masuit.Tools.Systems { /// /// stopwatch扩展 /// public static class StopwatchExtension { /// /// 检测方法执行时间 /// /// /// public static double Execute(Action action) { Stopwatch sw = Stopwatch.StartNew(); action(); return sw.ElapsedMilliseconds; } } }