slow - Initial commit
This commit is contained in:
commit
1870940c59
4 changed files with 110 additions and 0 deletions
21
slow.c
Normal file
21
slow.c
Normal 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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue