public Performance GetPerformance(TestConstraints testConstraints)
        {
            Stopwatch sw = new Stopwatch();            
            var trialDivison = new SieveOfEratosthenes(testConstraints.Limit);

            sw.Start();
            long prime = trialDivison.Primes.ToList().Last();

            return new Performance { RangeLimit = testConstraints.Limit, TimeTaken = sw.ElapsedMilliseconds };            
        }
Example #2
0
        public Performance GetPerformance(TestConstraints testConstraints)
        {
            Stopwatch sw = new Stopwatch();
            var trialDivison = new TrialDivisionByPrimes();

            sw.Start();
            long prime = trialDivison.Primes.TakeWhile(p => p < testConstraints.Limit).ToList().Last();

            return new Performance { RangeLimit = testConstraints.Limit, TimeTaken = sw.ElapsedMilliseconds };            
        }
 public List<Performance> DoWork(TestConstraints testConstraints)
 {
     return GetSieveOfErathosthenesPeformanceTimes(testConstraints.Limit, testConstraints.Increment);
 }
Example #4
0
 public List<Performance> DoWork(TestConstraints testConstraints)
 {
     return GetTrialDivisonPeformanceTimes(testConstraints.Limit, testConstraints.Increment);
 }