Ejemplo n.º 1
0
 /// <summary>
 /// Constructs a new instance of the Performance timer.
 /// </summary>
 /// <param name="completionSubscriber">An optional class that implements <see cref="IOnComplete{TimeSpan}"/>IOnComplete</param>
 public PerformanceTimer(IOnComplete <TimeSpan> completionSubscriber = null)
 {
     _completionSubscriber = completionSubscriber ?? new TraceCompletionSubscriber(category: null);
     _stopwatch            = Stopwatch.StartNew();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Constructs a new instance of the Performance timer.
 /// </summary>
 /// <param name="category">Optional category name to write to the Trace.Listeners collection.</param>
 public PerformanceTimer(string category = null)
 {
     _completionSubscriber = new TraceCompletionSubscriber(category);
     _stopwatch            = Stopwatch.StartNew();
 }