Add arg.h from sbase project.

git://git.suckless.org/sbase
This commit is contained in:
Simon Lieb 2013-08-06 13:13:14 +02:00
parent ee7d20ca0a
commit e8e98a8c1f
2 changed files with 64 additions and 4 deletions

13
slow.c
View file

@ -3,14 +3,19 @@
#include <stdio.h>
#include <unistd.h>
#include "arg.h"
char *argv0;
int main(int argc, char *argv[]) {
char buffer;
size_t nread;
useconds_t useconds = 1000000; // default 1 second
useconds_t useconds = 1000000; // default 1 second
if (argc == 2) {
useconds = atoi(argv[1]);
}
ARGBEGIN {
case 't':
useconds = atoi(ARGF());
} ARGEND;
while((nread = fread(&buffer, 1, sizeof buffer, stdin)) > 0) {
usleep(useconds);