コード例 #1
0
ファイル: Program.cs プロジェクト: ereznassimi/Lite-Profiler
        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());
        }
コード例 #2
0
 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;
     }
 }
コード例 #3
0
ファイル: Program.cs プロジェクト: ereznassimi/Lite-Profiler
        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();
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: ereznassimi/Lite-Profiler
        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();
        }