public static void DoTest() { long[] FactorsOf120 = new long[] { 2, 2, 2, 3, 5 }; Assert.AreEqual(FactorsOf120, SieveFactor.Factor(120)); }
static void SieveFactorTimer() { Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); long[] cache = SieveFactor.GetCache(NUMBER); for (int i = 0; i < ITERATION; i++) { SieveFactor.Factor(NUMBER, cache); } stopwatch.Stop(); Console.WriteLine("SieveFactor took : {0}ms", stopwatch.ElapsedMilliseconds); }