aboutsummaryrefslogtreecommitdiff
path: root/contrib/seq-read.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/seq-read.c')
-rw-r--r--contrib/seq-read.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/contrib/seq-read.c b/contrib/seq-read.c
new file mode 100644
index 0000000..90d201f
--- /dev/null
+++ b/contrib/seq-read.c
@@ -0,0 +1,20 @@
1#include <stdio.h>
2#include <stdlib.h>
3#include <time.h>
4
5int
6main(void)
7{
8 clock_t start = clock();
9 size_t sum = 0;
10
11 for ( int ch; (ch = getc(stdin)) != EOF; ) {
12 sum += (unsigned char) ch;
13 }
14
15 clock_t end = clock();
16
17 printf("Result: %zu, Duration: %.3lf sec\n", sum, ((double)(end - start)) / CLOCKS_PER_SEC);
18
19 return EXIT_SUCCESS;
20}