public static void FindPrimesAsync(PrimeNumberCalc pc) { Console.WriteLine(DateTime.Now); var a = pc.FindPrimeNumbersAsync(250000); Console.WriteLine(DateTime.Now); var b = pc.FindPrimeNumbersAsync(400000); Console.WriteLine(DateTime.Now); Console.WriteLine(a.Result); Console.WriteLine(b.Result); Console.WriteLine(DateTime.Now); }
private async void CalcBTN_Click(object sender, RoutedEventArgs e) { int num = int.Parse(NumInputTB.Text); NumInputTB.Clear(); var result = await primeCalc.FindPrimeNumbersAsync(num); AnswerTxtBlk.Text = result.ToString(); }