Many people told me there is a better way to create a delay for X amount of milliseconds. People told me about sleep command and usleep(), but I failed to make that work.
Currently I'm using this:
void delay(unsigned int mseconds) {
clock_t goal=mseconds+clock();
while(goal>clock());
}
And by doing this
delay(500);
printf("Hello there");
I can make text appear half a second later, but I want to find a better way to do this since people told me this is a bad method to do it and that it can be not very accurate.