TetaTricks/code/C/slowprint.c

21 lines
271 B
C
Raw Normal View History

2023-02-11 12:19:00 +01:00
#include <stdio.h>
#include <time.h>
#include <unistd.h>
int main(int argc, char *argv[])
{
int c;
struct timespec ts;
ts.tv_sec = 0;
ts.tv_nsec = 115 * 1000 * 1000;
while ( EOF != (c=getchar()) )
{
putchar(c);
fflush(stdout);
nanosleep(&ts, NULL);
}
return 0;
}