本文整理汇总了C#中IAdapter.GetProduct方法的典型用法代码示例。如果您正苦于以下问题:C# IAdapter.GetProduct方法的具体用法?C# IAdapter.GetProduct怎么用?C# IAdapter.GetProduct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAdapter
的用法示例。
在下文中一共展示了IAdapter.GetProduct方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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();
}
示例2: TestCombined
private void TestCombined(IAdapter adapter, int count)
{
int[] productIds = 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.GetPagedPersons(i * 25 + 3, 25);
adapter.GetSimple(2);
adapter.GetSimple(3);
adapter.GetProduct(productIds[i % productIds.Length]);
adapter.GetProduct2(productIds[i % productIds.Length]);
adapter.GetSimple(3);
adapter.GetPagedPersons(i * 25 + 3, 25);
adapter.GetProduct(productIds[i % productIds.Length]);
adapter.GetProduct2(productIds[i % productIds.Length]);
adapter.GetProduct(productIds[i % productIds.Length]);
adapter.GetSimple(3);
adapter.GetSimple(3);
adapter.GetProduct(productIds[i % productIds.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();
}