Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
 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();
 }
Exemplo n.º 4
0
 public void Dispose()
 {
     parent.AddTime(DateTime.UtcNow.Subtract(startTime));
     parent = null;
 }
Exemplo n.º 5
0
 internal TimerToken(AggregateTimer parentTimer)
 {
     parent    = parentTimer;
     startTime = DateTime.UtcNow;
 }