How to put a task to sleep (or delay) in C# 4.0?

Fulproof picture Fulproof · Mar 11, 2013 · Viewed 56k times · Source

There is Task.Delay in .NET 4.5

How can I do the same in .NET 4.0?

Answer

Eli Arbel picture Eli Arbel · Mar 12, 2013

Use the Microsoft.Bcl.Async package from NuGet, it has TaskEx.Delay.