Task vs Asynchronous delegates in c#?

后端 未结 2 2002
长情又很酷
长情又很酷 2021-02-20 08:38

I have this simple method :

static int Work (string s) { return s.Length; }

I could run it with :

Task task =          


        
2条回答
  •  星月不相逢
    2021-02-20 09:06

    Task is more elegant, and was introduced more recently (.Net 4) so if it meets your needs, I'd go with that.

提交回复
热议问题