Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

C# Thread Sleep vs Task Delay

// Thread Sleep vs Task Delay
int delayInSec = 3;

// Using Thread Sleep
Thread.Sleep(delayInSec * 1000);

// Using Task Delay
Task.Delay(delayInSec * 1000).Wait();
 
PREVIOUS NEXT
Tagged: #Thread #Sleep #Task #Delay
ADD COMMENT
Topic
Name
8+7 =