From 9750d3845bd5bbc2e5e76134b8c4a902faa9bce9 Mon Sep 17 00:00:00 2001 From: Epoch Qwert Date: Wed, 24 Dec 2014 07:31:09 -0600 Subject: added IPv6 support to hop0, peerip, and gopherd.sh gopherd.sh got lots of other updates too. speed is for measuring how many lines per second your pipes can do. --- src/bin/speed.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/bin/speed.c (limited to 'src/bin/speed.c') diff --git a/src/bin/speed.c b/src/bin/speed.c new file mode 100644 index 0000000..3b8cc72 --- /dev/null +++ b/src/bin/speed.c @@ -0,0 +1,21 @@ +#include +#include + +int count; + +void printandreset(int sig) { + alarm(1); + printf("persecond: %d\n",count); + count=0; +} + +int main(int argc,char *argv[]) { + char in[256]; + count=0; + signal(SIGALRM,printandreset); + alarm(1); + while(fgets(in,256,stdin)) { + count++; + } + return 0; +} -- cgit v1.2.3