码迷,mamicode.com
首页 > Web开发 > 详细

Parallel stepped for loops in .NET C# z

时间:2014-05-22 16:08:30      阅读:281      评论:0      收藏:0      [点我收藏+]

标签:style   blog   class   c   code   java   

bubuko.com,布布扣
for (int i = 0; i < 20; i += 2)


public IEnumerable<int> SteppedIntegerList(int startIndex,
            int endEndex, int stepSize)
{
        for (int i = startIndex; i < endEndex; i += stepSize)
    {
        yield return i;
    }
}


Parallel.ForEach(SteppedIntegerList(0, 20, 2), index =>
{

    Console.WriteLine("Index value: {0}", index);
});
bubuko.com,布布扣

 

Parallel stepped for loops in .NET C# z,布布扣,bubuko.com

Parallel stepped for loops in .NET C# z

标签:style   blog   class   c   code   java   

原文地址:http://www.cnblogs.com/zeroone/p/3744042.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!