#include<stdio.h>
#include<time.h>


int main()
{

    struct timespec t;
    t.tv_sec = 0;
    t.tv_nsec = 666666L;
    

    while (1)
    {   
        
        for(int i = 1; i<=50; i++)
        {
            printf("o");
            
            printf("\b ");
            nanosleep(&t, NULL);
        }    
        
       
        for(int i = 1; i<=50; i++)
        printf("\b");
    
    }
return 0;
    
}

Add a code snippet to your website: www.paste.org