/// <summary>The add to result.</summary> /// <param name="timer">The timer.</param> private void AddToResult(TimeMeasureItem timer) { var id = timer.Id; if (!this.measurementCounts.Last().ContainsKey(id)) { this.measurementCounts.Last().Add(id, 0); } this.measurementCounts.Last()[id]++; if (!this.measurements.Last().ContainsKey(id)) { this.measurements.Last().Add(id, 0); } this.measurements.Last()[id] += (DateTime.Now - timer.Value).TotalMilliseconds; }
/// <summary>The stop timer.</summary> /// <param name="timer">The timer.</param> private void StopTimer(TimeMeasureItem timer) { this.timers.Remove(timer); this.AddToResult(timer); }