Parallel.For

 static void Main(string[] args)
        {
            int i = 0;
            Parallel.For(0, 100, (x) =>
            {
                Console.WriteLine(i);
                i++;
            });
            Console.WriteLine($"i is {i}");
            Console.ReadLine();
        }

posted @ 2019-09-15 12:24 Fred1987 阅读(...) 评论(...) 编辑 收藏