当前位置: 首页>>代码示例>>C#>>正文


C# IAdapter.Prepare方法代码示例

本文整理汇总了C#中IAdapter.Prepare方法的典型用法代码示例。如果您正苦于以下问题:C# IAdapter.Prepare方法的具体用法?C# IAdapter.Prepare怎么用?C# IAdapter.Prepare使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IAdapter的用法示例。


在下文中一共展示了IAdapter.Prepare方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestGetPaggedPersons

        private void TestGetPaggedPersons(IAdapter adapter, int count)
        {
            long mcount = 0L;
            adapter.Prepare();
            Stopwatch stp = new Stopwatch();
            stp.Start();
            for (int i = 0; i < count; i++)
            {
                List<PersonInfoDto> infos = adapter.GetPagedPersons((count * 10) % 10000, 25);
                mcount += infos.Count;
            }
            stp.Stop();

            Console.WriteLine("{0,-30} - {1,6} ms ({2}) {3,6} us",
                adapter.Name,
                stp.ElapsedMilliseconds,
                mcount,
                Math.Round(1000.0 * stp.Elapsed.TotalMilliseconds / mcount, 4));

            adapter.Relase();
        }
开发者ID:harrison314,项目名称:MapperPerformace,代码行数:21,代码来源:PerformaceTester.cs

示例2: TestGetProduct

        private void TestGetProduct(IAdapter adapter, int count)
        {
            int[] ids = new int[]
            {
                316, 317, 318, 319, 320, 321, 322, 327, 330, 331, 346, 347, 348,
                351, 352,  724
            };

            adapter.Prepare();
            Stopwatch stp = new Stopwatch();
            stp.Start();
            for (int i = 0; i < count; i++)
            {
                adapter.GetProduct(ids[i % ids.Length]);
            }
            stp.Stop();

            Console.WriteLine("{0,-30} - {1,6} ms {2,6} us",
                adapter.Name,
                stp.ElapsedMilliseconds,
                Math.Round(1000.0 * stp.Elapsed.TotalMilliseconds / count, 4));

            adapter.Relase();
        }
开发者ID:harrison314,项目名称:MapperPerformace,代码行数:24,代码来源:PerformaceTester.cs

示例3: TestGetSimple

        private void TestGetSimple(IAdapter adapter, int count)
        {
            adapter.Prepare();
            Stopwatch stp = new Stopwatch();
            stp.Start();
            for (int i = 0; i < count; i++)
            {
                ShipMethodDto dto5 = adapter.GetSimple(5);
                ShipMethodDto dto3 = adapter.GetSimple(3);
                ShipMethodDto dto1 = adapter.GetSimple(1);
                ShipMethodDto dto2 = adapter.GetSimple(2);
                ShipMethodDto dto4 = adapter.GetSimple(4);
            }
            stp.Stop();

            Console.WriteLine("{0,-30} - {1,6} ms {2,6} us",
                adapter.Name,
                stp.ElapsedMilliseconds,
                Math.Round(1000.0 * stp.Elapsed.TotalMilliseconds / (5 * count), 4));

            adapter.Relase();
        }
开发者ID:harrison314,项目名称:MapperPerformace,代码行数:22,代码来源:PerformaceTester.cs

示例4: TestGetProduct2

        private void TestGetProduct2(IAdapter adapter, int count)
        {
            int[] ids = new int[]
            {
                752, 928, 756, 858, 711, 788, 743, 990, 948, 769, 979, 906, 833,
                741, 790, 776, 919, 822, 819, 976, 718, 913, 887, 751, 911, 739,
                765, 836, 873, 967,
            };

            adapter.Prepare();
            Stopwatch stp = new Stopwatch();
            stp.Start();
            for (int i = 0; i < count; i++)
            {
                adapter.GetProduct2(ids[i % ids.Length]);
            }
            stp.Stop();

            Console.WriteLine("{0,-30} - {1,6} ms {2,6} us",
                adapter.Name,
                stp.ElapsedMilliseconds,
                Math.Round(1000.0 * stp.Elapsed.TotalMilliseconds / count, 4));

            adapter.Relase();
        }
开发者ID:harrison314,项目名称:MapperPerformace,代码行数:25,代码来源:PerformaceTester.cs


注:本文中的IAdapter.Prepare方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。