Ejemplo n.º 1
0
            public override String ToString()
            {
                long inflight = inflightTimer.ElapsedMilliseconds;

                StringBuilder sb    = new StringBuilder("time in flight: " + inflight + " ms\n");
                long          total = 0;

                foreach (String name in timer.Keys)
                {
                    TimedStatistics.Timer t = timer[name];
                    long elapsed            = t.ElapsedMilliseconds;
                    total += elapsed;
                    double pct          = (double)elapsed / (double)inflight * 100;
                    double cntPerSecond = (double)t.Count * 1000.0 / (double)inflight;
                    sb.Append(name + ": " + elapsed + " ms (" + pct.ToString("0.000") + "%, " + cntPerSecond.ToString("0.0") + "x per sec, " + t.Count + "x)\n");
                }

                double totalPct = (double)total / (double)inflight * 100;

                sb.Append("Total: " + total + " ms (" + totalPct.ToString("0.000") + "%)\n");

                return(sb.ToString());
            }