Пример #1
0
        public void Test_UNSAFE_TASK(int[] arr)
        {
            var sw = new Stopwatch();

            sw.Start();

            ReaderIntArr ar       = new ReaderIntArr(arr);
            int          maxValue = ar.FindMaxValue(5);

            sw.Stop();
            Console.WriteLine($"UNSAFE+TASK: {sw.ElapsedMilliseconds}ms");
            Console.WriteLine($"Search result: {maxValue}");
            Console.WriteLine($"----------------------------");
        }
Пример #2
0
        public void Test_FOR(int[] arr)
        {
            var sw = new Stopwatch();

            sw.Start();

            ReaderIntArr ar       = new ReaderIntArr(arr);
            int          maxValue = ar.FindMaxValue_For();

            sw.Stop();
            Console.WriteLine($"Loop FOR: {sw.ElapsedMilliseconds}ms");
            Console.WriteLine($"Search result: {maxValue}");
            Console.WriteLine($"----------------------------");
        }