linux terminal animation - best way to delay printing of 'frame' (in C)
问题 I'm working on a simple pong clone for the terminal and need a way to delay the printing of a 'frame'. I have a two dimensional array screen[ROWS][COLUMNS] and a function that prints the screen void printScreen() { int i = 0; int j; while(i < ROWS) { j = 0; while(j < COLUMNS) { printf("%c", screen[i][j]); j++; } i++; } } It seems that when I do printScreen(); usleep(1000000); printScreen(); it will sleep the execution during printScreen() . Any tips for doing this type of animation on the