What is the best way to return a completed Task object?
It is possible to write Task.Delay(0), or Task.FromResult
But what is the
Answer from Stephen Toub (MSFT):
If you want a new Task object each time, Task.FromResult is the most efficient. Task.Delay(0) in its current implementation will return a cached task, but that's an implementation detail. If you want to use a cached task, you should cache one yourself, e.g. private static readonly Task s_completedTask = Task.FromResult(true); and then use s_completedTask.