slow - Initial commit

This commit is contained in:
Simon Lieb 2013-08-02 23:23:04 +02:00
commit 1870940c59
4 changed files with 110 additions and 0 deletions

21
slow.c Normal file
View file

@ -0,0 +1,21 @@
#define _XOPEN_SOURCE 500
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
char line[1024];
int linesize = sizeof(line);
int useconds = 1000000;
if (argc == 2) {
useconds = atoi(argv[1]);
}
while(fgets(line, linesize, stdin)) {
usleep(useconds);
fputs(line, stdout);
}
return 0;
}