I wanted the code below to put a $ on the screen, then wait like half a sec, followed by another, over and over. I tried different values as the value for a, and of course, they made it take longer or less time. However, for some odd reason, it seems to do the delay, then print the $'s so quick that one second there is 1 of them, next thing you know, you got all 49.
As an aside, see that function to clear the screen at the top, I wrote that - I'm so proud of myself, lol.
Code:
#include <stdio.h>
void cls() {
printf("\033[2J");
return;
}
int main() {
cls();
long a;
int times;
for (times = 0; times < 50; times++) {
for (a = 0; a <10000000; a++);
printf("$");
}