public OperationTimer(TimingLevel timingLevel, object target, ITimingStore store) { Store = store; if (!Store.Enabled) return; var op = target as IOperation; if (op == null) return; _timingLevel = timingLevel; _type = op.GetType(); _opaque = op.Opaque; _key = op.Key; _stopwatch = Stopwatch.StartNew(); }
public void EndTimer(TimingLevel level) { if (_timers != null && _timers.ContainsKey(level)) { IOperationTimer timer; if (_timers.TryGetValue(level, out timer)) { if (timer != null) { timer.Dispose(); _timers.Remove(level); } } } }
public void BeginTimer(TimingLevel level) { if (Timer != null) { var timer = Timer(level, this); if (_timers == null) { _timers = new Dictionary <TimingLevel, IOperationTimer>(); } if (!_timers.ContainsKey(level)) { _timers.Add(level, timer); } } }
public void BeginTimer(TimingLevel level) { if (Timer != null) { var timer = Timer(level, this); if (_timers == null) { _timers = new Dictionary<TimingLevel, IOperationTimer>(); } if (!_timers.ContainsKey(level)) { _timers.Add(level, timer); } } }
public OperationTimer(TimingLevel timingLevel, object target, ITimingStore store) { Store = store; if (!Store.Enabled) { return; } var op = target as IOperation; if (op == null) { return; } _timingLevel = timingLevel; _type = op.GetType(); _opaque = op.Opaque; _key = op.Key; _stopwatch = Stopwatch.StartNew(); }
public void EndTimer(TimingLevel level) { if (_timers != null && _timers.ContainsKey(level)) { IOperationTimer timer; if(_timers.TryGetValue(level, out timer)) { if (timer != null) { timer.Dispose(); _timers.Remove(level); } } } }