Пример #1
0
        private static long PrintMeasures(PerformanceMeasurer measurer, string message)
        {
            long totalMeasurerTime = measurer.Measures.Sum(x => x.Value.Time.ElapsedMilliseconds);

            Trace.Indent();
            foreach (var measure in measurer.Measures)
            {
                Trace.TraceInformation("Measure '{0}': {1} times in {2} ms ({3} ticks per time)", measure.Key, measure.Value.Calls, measure.Value.Time.ElapsedMilliseconds, measure.Value.Time.ElapsedTicks / measure.Value.Calls);
            }
            Trace.Unindent();
            Trace.TraceInformation("{1} is {0} ms.", totalMeasurerTime, message);

            return(totalMeasurerTime);
        }
Пример #2
0
 public PerformanceXmlSerializer() : base()
 {
     Measurer = new PerformanceMeasurer();
 }
 public PerformanceFileReader(FileReaderFolderCreationMode creationMode) : base(creationMode)
 {
     Measurer = new PerformanceMeasurer();
 }