static async void Start() { string s = "ass"; Console.WriteLine(getMemory(s)+"Hello World!" + Thread.CurrentThread.ManagedThreadId); await AsyncMethod(); Console.WriteLine(getMemory(s) + "End World!" + Thread.CurrentThread.ManagedThreadId); Console.WriteLine(); } static async Task AsyncMethod() { await Task.Run(() => { Console.WriteLine("AsyncMethod 执行," + Thread.CurrentThread.ManagedThreadId); }); }
是不一样的!
来源:博客园
作者:qgbo
链接:https://www.cnblogs.com/qgbo/p/11468527.html