test1
awaits Task.Delay(1)
, which isn't going to be completed at the time it goes to await it, meaning the rest of test1
needs to be scheduled as a continuation.
For test2
you're awaiting Task.FromResult
, which will always return an already completed Task
. When you await
an already completed task the method can just keep running on the current thread, without needing to schedule a continuation.