private static void Main(string[] args)
{
for (;;)
{
TemporaryCityTool.TemporaryCityTool.AddCity();
Console.WriteLine("waiting...");
Thread.Sleep(3600);
}
}
why Thread.sleep not working. I am getting message waiting all the time. I want that application will wait 10 minutes then continue again.
Thread.Sleeptakes a value in milliseconds, not seconds, so this only tells the current thread to wait 3.6 seconds. If you want to wait 10 minutes, use:This is probably an inappropriate use of
Sleep, though. Consider using a Timer instead, so that you get something along the lines of:See this StackOverflow thread for more details on that.