Exemple #1
0
        private void TestCliPerformance()
        {
            Stopwatch stopwatch = new Stopwatch();
            int       num       = 0x989680;

            stopwatch.Start();
            for (int i = 0; i < num; i++)
            {
                Test.SimpleTest(i);
            }
            stopwatch.Stop();
            long elapsedMilliseconds = stopwatch.ElapsedMilliseconds;

            stopwatch.Start();
            for (int j = 0; j < num; j++)
            {
                MyRDWrapper.SimpleTestShallow(j);
            }
            stopwatch.Stop();
            long num5 = stopwatch.ElapsedMilliseconds;

            stopwatch.Start();
            for (int k = 0; k < num; k++)
            {
                MyRDWrapper.SimpleTestDeep(k);
            }
            stopwatch.Stop();
            long num6 = stopwatch.ElapsedMilliseconds;
        }
        private void TestCliPerformance()
        {
            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
            long level0, level1, level2;
            int  n = 10000000;

            // Level0
            sw.Start();
            long sum = 0;

            for (int i = 0; i < n; i++)
            {
                sum += Test.SimpleTest(i);
            }
            sw.Stop();
            level0 = sw.ElapsedMilliseconds;

            // Level1
            sw.Start();
            sum = 0;
            for (int i = 0; i < n; i++)
            {
                sum += MyRDWrapper.SimpleTestShallow(i);
            }
            sw.Stop();
            level1 = sw.ElapsedMilliseconds;

            // Level2
            sw.Start();
            sum = 0;
            for (int i = 0; i < n; i++)
            {
                sum += MyRDWrapper.SimpleTestDeep(i);
            }
            sw.Stop();
            level2 = sw.ElapsedMilliseconds;
        }