Parallel stepped for loops in .NET C# z

Parallel stepped for loops in .NET C# z
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);
});
Parallel stepped for loops in .NET C# z

 

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

Parallel stepped for loops in .NET C# z

上一篇:远景WEBGIS平台实现客户端SHP文件加载


下一篇:MVC 授权过滤器 AuthorizeAttribute