Beispiel #1
0
        public static async void FindPrimeAsync() // 14 seconds
        {
            var a = await PrimeCounter.PrimeTaskLong(250000);

            Console.WriteLine(a);

            var b = await PrimeCounter.PrimeTaskLong(400000);

            Console.WriteLine(b);
        }
Beispiel #2
0
        public static async Task FindPrimeMultiThread() //12 seconds
        {
            var a = await Task.Run(() => PrimeCounter.PrimeLong(250000));

            Console.WriteLine(a);

            var b = await Task.Run(() => PrimeCounter.PrimeLong(400000));

            Console.WriteLine(b);
        }
Beispiel #3
0
        public static void FindPrime() // 14 seconds
        {
            var a = PrimeCounter.PrimeLong(250000);

            Console.WriteLine(a);

            var b = PrimeCounter.PrimeLong(400000);


            Console.WriteLine(b);
        }