private static Dictionary <Benchmark, BuildResult> BuildInParallel(ILogger logger, string rootArtifactsFolderPath, Func <Job, IToolchain> toolchainProvider, IResolver resolver, Benchmark[] benchmarks, ReadOnlyConfig config, ref StartedClock globalChronometer)
        {
            using (benchmarks.Select(benchmark => GetAssemblyResolveHelper(toolchainProvider(benchmark.Job), logger)).FirstOrDefault(helper => helper != null))
            {
                logger.WriteLineHeader($"// ***** Building {benchmarks.Length} benchmark(s) in Parallel: Start   *****");

                var buildResults = benchmarks
                                   .AsParallel()
                                   .Select(benchmark => { return(benchmark, buildResult: Build(benchmark, config, rootArtifactsFolderPath, toolchainProvider, resolver)); })
                                   .ToDictionary(result => result.benchmark, result => result.buildResult);

                logger.WriteLineHeader($"// ***** Done, took {globalChronometer.GetElapsed().GetTimeSpan().ToFormattedTotalTime()}   *****");

                return(buildResults);
            }
        }
Exemplo n.º 2
0
        public void Dispose()
        {
            var elapsed = _startedClock.GetElapsed();

            Duration = elapsed.GetTimeValue().ToMilliseconds();
        }
Exemplo n.º 3
0
 public void Dispatch()
 {
     Action(Index, StartedClock.GetElapsed());
 }