Basic timer function.

Hi. I am writing a very basic function to be used as a timer.
I want it to simply print the number, then clear the screen.
I do not want to use the System('cls') function for clearing the screen.
atm the function seems very weird and glitchy. Any advice?



1
2
3
4
5
6
7
8
9
void timer(int n){
	do{
	cout<< n;
	n--;
    cout<< "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
	Sleep(100);
	}
	while (n>0);
}
I should probably clarify that "n" is the parameter used for the amount of milliseconds to count-down.
Topic archived. No new replies allowed.