Ejemplo n.º 1
0
        public ReportingStopwatch(INumericReport report, string name)
        {
            _report = report;
            _name   = name;

            _stopwatch = new Stopwatch();
            _stopwatch.Start();
        }
Ejemplo n.º 2
0
 public static IDisposable TimeAndReport(this INumericReport @this, string name)
 {
     return(new ReportingStopwatch(@this, name));
 }
Ejemplo n.º 3
0
        public static void Report(this INumericReport @this, string name, Stopwatch stopwatch)
        {
            var dt_sec = ((double)stopwatch.ElapsedTicks) / Stopwatch.Frequency;

            @this.Report(name, dt_sec);
        }