I just can't find a way to sleep my program or just make it wait for a set amount of miliseconds, I tried sleep() but it only works for full seconds, usleep() is giving implicit declaration error and correcting it to sleep(), nanosleep() also only pauses it for full seconds.
while(1){
wclear(win);
box(win, 0, 0);
mvwprintw(win, 0, anim, "Snake");
wrefresh(win);
sleep(500);
if(intro == 3){
if(anim < 53) anim++;
else intro--;
}
if(intro == 2){
if(anim > 2) anim--;
else intro--;
}
if(intro == 1){
if(anim < 23) anim++;
else intro--;
}
if(intro == 0) break;
}
All I want is to make a smooth little animation, but no matter what library I use or what kind of sleep function I use, it will either do full seconds which is too long, or 0 seconds (so nothing), or throw errors.