summaryrefslogtreecommitdiff
path: root/src/bin/speed.c
diff options
context:
space:
mode:
authorEpoch Qwert <epoch@53flpnlls43fcguy.onion>2014-12-24 07:31:09 -0600
committerEpoch Qwert <epoch@53flpnlls43fcguy.onion>2014-12-24 07:31:09 -0600
commit9750d3845bd5bbc2e5e76134b8c4a902faa9bce9 (patch)
tree1b38f9a5a0e80eee6be6d93d33aeab0dd9ca641b /src/bin/speed.c
parent612926651db0c13fa9f45f58764b56ab132b211c (diff)
downloadmisc-9750d3845bd5bbc2e5e76134b8c4a902faa9bce9.tar.gz
misc-9750d3845bd5bbc2e5e76134b8c4a902faa9bce9.zip
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.
Diffstat (limited to 'src/bin/speed.c')
-rw-r--r--src/bin/speed.c21
1 files changed, 21 insertions, 0 deletions
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 <stdio.h>
+#include <signal.h>
+
+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;
+}