The output to stdout
is buffered. Using \n
you are forcing a flush. If you want to change this, you will need to change the settings of the terminal (for Linux look here) or use
void typestring(const char *str, useconds_t delay)
{
while (*str) {
putchar(*(str++));
fflush(stdout);
usleep(delay);
}
}