Answers for "await delay c#"

C#
3

c# async sleep

// Async
await Task.Delay(1000); //when you want a logical delay without blocking the current thread
// Not Async
Thread.Sleep(1000) //when you want to block the current thread.
Posted by: Guest on August-22-2020
0

how to delay execution in c#

int sleepTime = 1000; // in mills
Task.Delay(sleepTime).Wait();
// or
Thread.Sleep(sleepTime);
Posted by: Guest on July-17-2020

C# Answers by Framework

Browse Popular Code Answers by Language