I want to test if different loops are active, so I have a print statement that repeats every 500ms in each loop, however the print statement does not print every 500ms, it waits until the loop is finished and then prints everything at once instead of periodically.
How do I get my program to print to the terminal periodically?
I'm a student so my knowledge of SDL is pretty limited so thorough explanation would be appreciated.
int main(void)
{
int i = 0;
while(i<10)
{
printf("While loop active.\t"); i++;
SDL_Delay(500);
}
return 0;
}
P.S. I saw that duplicate question but I disagree as his question suggests an issue with 'signal handling' which I know nothing about so when asking this question, I didn't think his question would have the same answer as mine. I accept the answers given are the same though.