From 3098bf78d30fcfe1f1187c99cd68960d134ea846 Mon Sep 17 00:00:00 2001 From: margarita-krasnova Date: Mon, 30 Dec 2024 22:54:22 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B8=D1=82=D1=8C=20Pr?= =?UTF-8?q?ogram.cs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Program.cs | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 Program.cs diff --git a/Program.cs b/Program.cs deleted file mode 100644 index 2eb21a0..0000000 --- a/Program.cs +++ /dev/null @@ -1,36 +0,0 @@ -using rvip_5; -using System.Diagnostics; -using System; -using System.Collections.Generic; -public class Benchmark -{ - public static void Main(string[] args) - { - int[] matrixSizes = { 100, 300, 500 }; - int[] threadCounts = { 1, 2, 4, 8, 16 }; - - foreach (int size in matrixSizes) - { - Console.WriteLine($"Размер матрицы: {size}x{size}"); - Matrix matrixA = new Matrix(size); - Matrix matrixB = new Matrix(size); - - Console.WriteLine("Бенчмаркинг последовательного алгоритма..."); - Stopwatch stopwatchSequential = Stopwatch.StartNew(); - matrixA.MultiplySequential(matrixB); - stopwatchSequential.Stop(); - Console.WriteLine($"Время выполнения последовательного алгоритма: {stopwatchSequential.ElapsedMilliseconds} мс"); - - Console.WriteLine("Бенчмаркинг параллельного алгоритма..."); - foreach (int threads in threadCounts) - { - Stopwatch stopwatchParallel = Stopwatch.StartNew(); - matrixA.MultiplyParallel(matrixB, threads); - stopwatchParallel.Stop(); - Console.WriteLine($"Время выполнения параллельного алгоритма ({threads} потоков): {stopwatchParallel.ElapsedMilliseconds} мс"); - } - Console.WriteLine("-----------------------------"); - } - Console.ReadKey(); - } -} \ No newline at end of file