Beispiel #1
0
        public void Dispose()
        {
            _stopwatch.Stop();
            var timeSpan = _stopwatch.Elapsed;

            LogCat.LogFormat("{0} 统计耗时结束,总共耗时{1}秒", this._name, timeSpan.TotalMilliseconds / 1000);
        }
Beispiel #2
0
 public StopwatchScope(string name = StringConst.String_Empty)
 {
     this._name = name;
     _stopwatch = new Stopwatch();
     _stopwatch.Start();
     LogCat.LogFormat("{0} 开始统计耗时", this._name);
 }