public static void Demo_3(long n) { LiteProfiler.Reset(filterClasses: true); using (LiteProfilerAgent agent = new LiteProfilerAgent()) { long heavy = TimeConsuming.HeavyCalculation(n); Console.WriteLine($"Heavy Calculation({n}) = {heavy}"); } Console.Write(LiteProfiler.GetReport().PrettyPrint()); }
public static long OneStep(long i) { using (LiteProfilerAgent agent = new LiteProfilerAgent()) { long c = random.Next(1, Max); long result = ((i * c) % Max) + 1; Console.SetCursorPosition(0, 0); Console.WriteLine($"(({i} * {c}) % {Max}) + 1 = {result}"); Console.WriteLine(LiteProfiler.GetQuote($"step starts with i = {i}").PrettyPrint()); return result; } }
public static void Demo_1(long n) { using (LiteProfilerAgent agent = new LiteProfilerAgent()) { long prime = PrimeNumbers.Find(n); Console.SetCursorPosition(0, 2); Console.WriteLine($"Prime #{n} = {prime}"); } Console.Write(LiteProfiler.GetReport().PrettyPrint()); NextDemo(); }
static void Main(string[] args) { LiteProfiler.Reset(); LiteProfiler.SuspiciousClasses = new HashSet <string>(File.ReadAllLines((args.Length > 0) ? args[0] : "classes.txt")); Console.WriteLine($"n = {n}"); using (LiteProfilerAgent agent = new LiteProfilerAgent()) { Demo_1(n); Demo_2(n); } Console.Write(LiteProfiler.GetReport().PrettyPrint()); NextDemo(); Demo_3(n); Console.ReadKey(); }