public ChunkBoundary GetNextBonBoundary() { var b = Count * _chunkSize; Int64 low = b + 1; Int64 top = b + _chunkSize; var boundary = new ChunkBoundary(low, top, Count); Count++; return(boundary); }
private ProcessingResult ProcessChunk(ChunkBoundary boundary) { //if (boundary.BondaryCount % 1 == 0) { var totalChecks = boundary.BondaryCount * ChunkSize; var totalSeconds = (DateTime.Now - this._startTime).TotalSeconds + 1; var checkPrsec = (totalChecks / totalSeconds); var checksPrSecStr = FormatInteger((int)(checkPrsec)); Console.WriteLine($"Finished boundary: {FormatInteger(boundary.End)} => {checksPrSecStr}/s"); var remaningTo10 = (3778888999 - totalChecks) / checkPrsec; var remaningTo11 = (277777788888899 - totalChecks) / checkPrsec; var minutesTo10 = remaningTo10 / 60; var daysTo11 = remaningTo11 / 60 / 60 / 24; Console.WriteLine($"Time until '3778888999': {(int)minutesTo10} minutes."); Console.WriteLine($"Time until '277777788888899': {(int)daysTo11} days."); //} var resultSet = new ProcessingResult(); for (Int64 i = boundary.Start; i < boundary.End; i++) { var result = _algorithm.CalculatePersistence(i); // we are only looking for the first; as the first is the lowest input value. if (resultSet.results.ContainsKey(result)) { continue; } resultSet.results.Add(result, i); } return(resultSet); }