Exemple #1
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);
        }
Exemple #2
0
        public static void FindPrime() // 14 seconds
        {
            var a = PrimeCounter.PrimeLong(250000);

            Console.WriteLine(a);

            var b = PrimeCounter.PrimeLong(400000);


            Console.WriteLine(b);
        }