I have a console application and I want to create a countdown timer. This is what I have tried:
static void Main(string[] args)
{
for (int a = 10; a >= 0; a--)
{
Console.Write("Generating Preview in {0}", a);
System.Threading.Thread.Sleep(1000);
Console.Clear();
}
}
This code works in some situations. However, the problem is that it clears the entire console window and cannot be used when there are some characters above the timer.