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  FredGrit  阅读(262)  评论(0编辑  收藏  举报