public override string Format(ResultBase result) { var r = result as PerformanceResult; var f = "{0:" + NumFormat + "}"; var root = new XElement("PerformanceResult", new XElement("Header", new XElement("Iterations", r.Iterations), new XElement("DegreeOfParallelism", r.DegreeOfParallelism), new XElement("TotalSeconds", String.Format(f, r.TotalSeconds)), new XElement("TotalMilliseconds", String.Format(f, r.TotalMilliseconds)), new XElement("TotalTicks", String.Format(f, r.TotalTicks)) )); var details = XElement.Parse(_descriptiveFormatter.Format(r.DescriptiveResult)); root.Add(details); return(root.ToString()); }
public override string Format(ResultBase result) { var sb = new StringBuilder(); var r = result as PerformanceResult; sb.AppendLine("Iterations,DegreeOfParallelism"); sb.AppendLine(String.Format("{0},{1}", r.Iterations, r.DegreeOfParallelism)); var f = "{0:" + NumFormat + "}"; var t = String.Format(f, r.TotalTicks); var s = String.Format(f, r.TotalSeconds); var m = String.Format(f, r.TotalMilliseconds); sb.AppendLine("TotalSeconds,TotalMilliseconds,TotalTicks"); sb.AppendLine(String.Format("{0},{1},{2}", s, m, t)); sb.AppendLine(); sb.Append(_descriptiveFormatter.Format(r.DescriptiveResult)); return(sb.ToString()); }
public override string Format(ResultBase result) { var sb = new StringBuilder(); var r = result as PerformanceResult; sb.AppendLine(String.Format("Total Iterations: {0}", r.Iterations)); sb.AppendLine(String.Format("Degree Of Parallelism: {0}", r.DegreeOfParallelism)); var f = "{0:" + NumFormat + "}"; var t = String.Format(f, r.TotalTicks); var s = String.Format(f, r.TotalSeconds); var m = String.Format(f, r.TotalMilliseconds); sb.AppendLine(String.Format("Total Time: {0} seconds, {1} milliseconds, {2} ticks", s, m, t)); sb.AppendLine(); sb.AppendLine("Statistics (ms)"); sb.AppendLine("---------------"); sb.Append(descriptiveFormatter.Format(r.DescriptiveResult)); return(sb.ToString()); }