Skip to content

Instantly share code, notes, and snippets.

@supermomonga
Created December 25, 2012 10:26
Show Gist options
  • Save supermomonga/4372556 to your computer and use it in GitHub Desktop.
Save supermomonga/4372556 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <unistd.h>
int main(void) {
int i;
useconds_t delay = 20000;
fprintf(stderr, "Begin counting up.\n");
for(i = 1; i <= 100; i++) {
fprintf(stderr, "%d\r", i);
fflush(stderr);
usleep(delay);
}
fprintf(stderr, "\n");
fprintf(stderr, "End counting up.\n");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment