Async programming lets you run long tasks without freezing your app’s UI. You use Async
methods with Await
to pause execution until tasks finish — but the UI stays responsive.
Task.Delay(ms)
is like Thread.Sleep
, but async — it pauses without blocking your thread or freezing UI.
Async Function
lets you use Await
inside.Await Task.Delay()
pauses the method without blocking.Task
that can be awaited or run on its own.
Wrap your Await
calls inside Try...Catch
to catch exceptions from async methods.
Async/Await
for I/O, file, network, or long CPU-bound tasks.Thread.Sleep
in async code — use Task.Delay
instead.Async Sub
is mainly for event handlers — avoid it elsewhere to allow proper error handling.