コード例 #1
0
ファイル: Log.cs プロジェクト: AdamWhiteHat/MaurerPrimes
        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();
        }
コード例 #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();
 }
コード例 #3
0
 static CryptoRandomSingleton()
 {
     executionTimer = new AggregateTimer();
     rng            = new RNGCryptoServiceProvider();
 }
コード例 #4
0
 public void Dispose()
 {
     parent.AddTime(DateTime.UtcNow.Subtract(startTime));
     parent = null;
 }
コード例 #5
0
 internal TimerToken(AggregateTimer parentTimer)
 {
     parent    = parentTimer;
     startTime = DateTime.UtcNow;
 }