Console logging updated
This commit is contained in:
1 parent
fa4bb0bcc1
commit
3d43d52f2e
1 file changed
+6
-3
@@ -242,20 +242,20 @@ public static class MersenneNumberDivisorByDivisorTester
|
|||||||
|
|
||||||
void ProcessPrime(ulong prime)
|
void ProcessPrime(ulong prime)
|
||||||
{
|
{
|
||||||
Console.WriteLine($"Task started {prime}");
|
Console.WriteLine($"Processing {prime}");
|
||||||
bool isPrime = tester.IsPrime(prime, out bool divisorsExhausted);
|
bool isPrime = tester.IsPrime(prime, out bool divisorsExhausted);
|
||||||
|
|
||||||
if (!isPrime)
|
if (!isPrime)
|
||||||
{
|
{
|
||||||
markComposite();
|
markComposite();
|
||||||
printResult(prime, true, true, false);
|
printResult(prime, true, true, false);
|
||||||
Console.WriteLine($"Task finished {prime}");
|
Console.WriteLine($"Finished processing {prime}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
clearComposite();
|
clearComposite();
|
||||||
printResult(prime, true, divisorsExhausted, true);
|
printResult(prime, true, divisorsExhausted, true);
|
||||||
Console.WriteLine($"Task finished {prime}");
|
Console.WriteLine($"Finished processing {prime}");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (workerCount == 1)
|
if (workerCount == 1)
|
||||||
@@ -294,11 +294,14 @@ public static class MersenneNumberDivisorByDivisorTester
|
|||||||
() =>
|
() =>
|
||||||
{
|
{
|
||||||
startGate.Wait();
|
startGate.Wait();
|
||||||
|
Console.WriteLine($"Task started for range {rangeStart}");
|
||||||
|
|
||||||
for (int index = rangeStart; index < rangeEnd; index++)
|
for (int index = rangeStart; index < rangeEnd; index++)
|
||||||
{
|
{
|
||||||
ProcessPrime(filteredPrimes[index]);
|
ProcessPrime(filteredPrimes[index]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Console.WriteLine($"Task finished for range {rangeStart}");
|
||||||
},
|
},
|
||||||
CancellationToken.None,
|
CancellationToken.None,
|
||||||
TaskCreationOptions.DenyChildAttach,
|
TaskCreationOptions.DenyChildAttach,
|
||||||
|
|||||||
Reference in new issue
Block a user