I have display timer that resets after a four seconds
and on display i wanna it count down instead of up.
It's rather difficult to tell what you are trying to
accomplish, especially with the string reversal.
Taking your general description of the objective at
face value - how to display the time elapsed as a
countdown rather than an incrementing count - one
simple approach (given that you know the limit) is
to subtract the elapsed time from the time limit
which is 4 seconds in your case.
For example:
int duration = 4;
for (int n = 0; n < duration; ++n)
{
Console.Write("\r");
Console.Write(n + 1);
// Sleep ...
}
for (int n = 0; n < duration; ++n)
{
Console.Write("\r");
Console.Write(duration - n);
// Sleep ...
}
- Wayne