Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

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.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #async #sleep
ADD COMMENT
Topic
Name
4+5 =