private static DepthCounter depth; // Use a class instead of mutating a static variable static Log() { loggingEnabled = false; LogFilename = "Methods.log.txt"; depth = new DepthCounter(); executionTimer = new AggregateTimer(); }
static Eratosthenes() { _executionTimer = new AggregateTimer(); _cacheCeiling = BigInteger.Pow(11, 7); _membershipArray = new bool[0]; _primeCache = new BigInteger[0]; //_membershipArray = new bool[] { false, false, true, true, false, true, false, true, false, false, false, true, false, true, false, false, false, true, false, true, false, false, false, true, false, false, false, false, false, true, false, true, false, false, false, false, false, true, false, false, false, true, false, true, false, false, false, true }; //_primeCache = new BigInteger[] { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47 }; _primeCache = Sieve(2, (long)_cacheCeiling); _cacheLargestPrimeCurrently = _primeCache.Last(); }
static CryptoRandomSingleton() { executionTimer = new AggregateTimer(); rng = new RNGCryptoServiceProvider(); }
public void Dispose() { parent.AddTime(DateTime.UtcNow.Subtract(startTime)); parent = null; }
internal TimerToken(AggregateTimer parentTimer) { parent = parentTimer; startTime = DateTime.UtcNow; }