C# Task,new Task().Start(),Task.Run();TTask.Factory.StartNew

时间:2016-08-18 00:44:36   收藏:0   阅读:2678

1.

Task task = new Task(() =>
{
MultiplyMethod(a, b);
});
task.Start();

2.

Task task = Task.Run(() =>
{
MultiplyMethod(a, b);
});

3.

Task task = Task.Factory.StartNew(() =>
{
MultiplyMethod(a, b);
});

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!