Есть следующий код, требует выполнить следующее:По результатам параллельной обработки 10 различных изображений построить график зависимости времени работы алгоритма от площади изображения.
Код:
using SelectionSections;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Windows.Forms;

namespace ImageEditing
{
    public partial class Form1 : Form
    {
        private List<BackgroundWorker> workers = new List<BackgroundWorker>();
        BackgroundWorker worker = new BackgroundWorker();
        public Form1()
        {
            InitializeComponent();
            openFileDialog.Filter = "PNG Изображения (*.png)|*.png|Все файлы(*.*)|*.*";
            saveFileDialog.Filter = "PNG Изображения (*.png)|*.png|Все файлы(*.*)|*.*";
            openFileDialog.Multiselect = true;
            for (int i = 0; i < 10; i++)
            {
                worker.WorkerReportsProgress = true;
                worker.DoWork += Worker_DoWork;
                worker.ProgressChanged += Worker_ProgressChanged;
                worker.RunWorkerCompleted += Worker_RunWorkerCompleted;
                workers.Add(worker);
            }

        }

        private void openButton_Click(object sender, EventArgs e)
        {
            if (openFileDialog.ShowDialog() == DialogResult.Cancel)
                return;
            int n = 0;
            foreach (string fileName in openFileDialog.FileNames)
            {
                sourceListBox.Items.Add(fileName);
            }

        }




        private void Worker_DoWork(object sender, DoWorkEventArgs e)
        {
            List<object> arguments = (List<object>)e.Argument;
            Bitmap image = (Bitmap)arguments[0];
            string filename = (string)arguments[1];
            int width = image.Width;
            int height = image.Height;

            ProgressDelegate progress = UpdateProgressBar;
            SortedList<string, object> parametrs = new SortedList<string, object>
            {
                { "source", (Bitmap) image },
                { "threshold", (double) 10 }
            };

            GrowSection growSection = new GrowSection();
            growSection.Init(parametrs);
            Stopwatch stopwatch = Stopwatch.StartNew();
            growSection.StartHandle(progress);
            stopwatch.Stop();


            e.Result = new List<object> { growSection.Result, filename, width, height, stopwatch.ElapsedMilliseconds };
        }

        private void Worker_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {

            //if (sectionProgressBar.InvokeRequired)
            //{
            //    sectionProgressBar.BeginInvoke(new Action(() => { sectionProgressBar.Value = e.ProgressPercentage; }));
            //}
            //else
            //{
            //    sectionProgressBar.Value = e.ProgressPercentage;
            //}
        }


        private void Worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            List<object> results = (List<object>)e.Result;
            Bitmap outputImage = (Bitmap)results[0];
            string filename = (string)results[1];
            int width = (int)results[2];
            int height = (int)results[3];
            long processingTime = (long)results[4];
           
            // Save the output image
            string outputFilename = Path.GetFileNameWithoutExtension(filename) + "_processed.png";
            outputImage.Save(outputFilename);
            resultListBox.Invoke(new Action(()=> resultListBox.Items.Add(new ImageListBoxItem { Text = $"{filename} {width}  {height}  {processingTime} ms", Image1 = new Bitmap(filename), Image2 = outputImage })));

            BackgroundWorker worker = (BackgroundWorker)sender;
            workers.Remove(worker);
        }

        private void saveButton_Click(object sender, EventArgs e)
        {
           
        }

        private void UpdateProgressBar(double percent)
        {
            //if (sectionProgressBar.InvokeRequired)
            //{
            //    sectionProgressBar.BeginInvoke(new Action(() => { sectionProgressBar.Value = (int)System.Math.Round((decimal)percent); }));
            //}
            //else
            //{
            //    sectionProgressBar.Value = (int)System.Math.Round((decimal)percent);
            //}
        }

        private void progressListBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (resultListBox.SelectedItem != null)
            {
                ImageListBoxItem selectedItem = resultListBox.SelectedItem as ImageListBoxItem;


            }
        }

        private void generateButton_Click(object sender, EventArgs e)
        {

            BackgroundWorker secondWorker = new BackgroundWorker();
            secondWorker.DoWork += SecondWorker_DoWork;
            secondWorker.RunWorkerAsync();

        }

        private void SecondWorker_DoWork(object sender, DoWorkEventArgs e)
        {

            int n = 0;
            while (n < sourceListBox.Items.Count)
            {
                var work = workers.FirstOrDefault(f => f.IsBusy == false);
                if (work != null)
                {


                    Bitmap image = new Bitmap(openFileDialog.FileNames[n]);
                    List<object> arguments = new List<object>();
                    arguments.Add(image);
                    arguments.Add(openFileDialog.FileNames[n]);
                    work.RunWorkerAsync(arguments);
                    n++;
                }
            }
           
        }

        public class ImageListBoxItem
        {
            public string Text { get; set; }

            public System.Drawing.Image Image1 { get; set; }
            public System.Drawing.Image Image2 { get; set; }

            public override string ToString()
            {
                return Text;
            }
        }

        
    }
}