Skip to content

Commit

Permalink
Logs: add total time
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyAkinshin committed Jan 17, 2016
1 parent 0349614 commit f2c6f16
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion BenchmarkDotNet/BenchmarkRunner.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using BenchmarkDotNet.Extensions;
Expand Down Expand Up @@ -58,6 +59,7 @@ private List<BenchmarkReport> Run(List<Benchmark> benchmarks, IBenchmarkLogger l

var importantPropertyNames = benchmarks.Select(b => b.Properties).GetImportantNames();

var globalStopwatch = Stopwatch.StartNew();
var reports = new List<BenchmarkReport>();
foreach (var benchmark in benchmarks)
{
Expand All @@ -81,10 +83,11 @@ private List<BenchmarkReport> Run(List<Benchmark> benchmarks, IBenchmarkLogger l
}
logger.NewLine();
}
globalStopwatch.Stop();
logger.WriteLineHeader("// ***** BenchmarkRunner: Finish *****");
logger.NewLine();

logger.WriteLineHeader("// * Export *");
logger.WriteLineHeader("// * Export *");
var files = Plugins.CompositeExporter.ExportToFile(reports, competitionName, Plugins.ResultExtenders);
foreach (var file in files)
logger.WriteLineInfo($" {file}");
Expand All @@ -99,6 +102,8 @@ private List<BenchmarkReport> Run(List<Benchmark> benchmarks, IBenchmarkLogger l
logger.NewLine();
}

logger.WriteLineStatistic($"Total time: {globalStopwatch.Elapsed.TotalHours:00}:{globalStopwatch.Elapsed:mm\\:ss}");
logger.NewLine();

logger.WriteLineHeader("// * Summary *");
BenchmarkMarkdownExporter.Default.Export(reports, logger, Plugins.ResultExtenders);
Expand Down

0 comments on commit f2c6f16

Please sign in to comment.