Created
March 4, 2020 07:36
-
-
Save deobfuscate/58d4a3da60d35fe4a3fc0f2b740272cb to your computer and use it in GitHub Desktop.
Simple ASCII spinner in C
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <unistd.h> | |
#define DELAY 100000 // microseconds | |
void main() { | |
printf(" "); | |
while(1) { | |
printf("\b|"); | |
fflush(stdout); | |
usleep(DELAY); | |
printf("\b/"); | |
fflush(stdout); | |
usleep(DELAY); | |
printf("\b-"); | |
fflush(stdout); | |
usleep(DELAY); | |
printf("\b\\"); | |
fflush(stdout); | |
usleep(DELAY); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment