Thread.Sleep doesn't seem to be supported in .NET for Windows Store apps.
For example, this
System.Threading.Thread.Sleep(1000);
will compile when targeting any .NET Framework (2.0, 3.5, 4.0, 4.5), but not when targeting .NET for Windows Store apps (or in a portable class library which targets both 4.5 and store).
System.Threading.Thread is still there, it just doesn't have the Sleep method.
I need to delay something for a few seconds in my app, is there a suitable replacement?
EDIT why the delay is needed: My app is a game and the delay is to make it look like the computer opponent is "thinking" about his next move. The method is already called asynchronously (main thread isn't blocked), I just want to slow the response time down.
Monitor
class? You can use theWait
method with a timeout to simulate a sleep. – TudorThread.Sleep
to the dustbin of bad tech. – spender