What's the best implemention for non-blocking wait/delay for a period of time in c#
问题 Currently I need to implement a simple non-blocking delay function in a Windows Store app project. This function should do nothing, just idle for a specific period of time without blocking the UI. My question is: how to implement such a function properly? I know this is an old question, but I really have no clue after some search online. Best wishes! [Edit] I've tried this but not work. public static async Task WaitFor(int millisecondsDelay) { var idleTask = Task.Run(() => { Task.Delay