Caffeinated Coder
Book an appointment
Lesson 17 · Advanced .NET

async and await

async and await let a C# method wait for slow work without holding a thread. Follow one real program line by line: an async method runs normally until it awaits an unfinished Task, then saves its place and returns that Task to its caller at once. The caller keeps working, and when the timer fires, a thread-pool thread resumes the method, completes the Task and hands its result to the await. The output is Start, Fetch, Working, Data.

14 min10 steps5 questionsAdvanced
Fig 17 · Interactive
Loading figure…
or ← →

Quiz Unlocks after the last step.