and and PCL (Portable Class Library)
c# - Thread.Sleep replacement in .NET for Windows Store - Stack Overflow
Windows Store apps embrace asynchrony - and an "asynchronous pause" is provided by
Task.Delay
. So within an asynchronous method, you'd write:await Task.Delay(TimeSpan.FromSeconds(30));
... or whatever delay you want. The asynchronous method will continue 30 seconds later, but the thread will not be blocked, just as for all
await
expressions.Behind the simplified syntax is a timer, so there is some overhead.
It just from one place (theread/OS) to another (generated code).
Price of progress...
It just from one place (theread/OS) to another (generated code).
Price of progress...
No comments:
Post a Comment