Exemplo n.º 1
0
        /// <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;
        }
Exemplo n.º 2
0
 /// <summary>The stop timer.</summary>
 /// <param name="timer">The timer.</param>
 private void StopTimer(TimeMeasureItem timer)
 {
     this.timers.Remove(timer);
     this.AddToResult(timer);
 }