I have to admit that I think that Microsoft misnamed
Sleep
and it should have been
SleepMilliseconds
. However a way to do what you want without the complexity of dealing with
TimeSpan
is to create a new class to encapsulate the Sleep method.
namespace ConsoleApplication
{
public static class Sleep
{
public static void Seconds(int seconds)
{
System.Threading.Thread.Sleep(seconds * 1000);
}
public static void Minutes(int minutes)
{
System.Threading.Thread.Sleep(minutes * 60000);
}
}
}
To provide more flexibility you could set the argument type to
double
.