diff options
Diffstat (limited to 'seq-read.c')
| -rw-r--r-- | seq-read.c | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -8,14 +8,14 @@ main(void) | |||
| 8 | clock_t start = clock(); | 8 | clock_t start = clock(); |
| 9 | size_t sum = 0; | 9 | size_t sum = 0; |
| 10 | 10 | ||
| 11 | #if 0 | 11 | #if 1 |
| 12 | int ch; | 12 | int ch; |
| 13 | while ((ch = getc(stdin)) != EOF) { | 13 | while ((ch = getc(stdin)) != EOF) { |
| 14 | sum += (unsigned char) ch; | 14 | sum += (unsigned char) ch; |
| 15 | } | 15 | } |
| 16 | #endif | 16 | #endif |
| 17 | 17 | ||
| 18 | #if 1 | 18 | #if 0 |
| 19 | unsigned char buffer[1024]; | 19 | unsigned char buffer[1024]; |
| 20 | size_t n; | 20 | size_t n; |
| 21 | while ((n = fread(buffer, 1, sizeof buffer, stdin)) > 0) { | 21 | while ((n = fread(buffer, 1, sizeof buffer, stdin)) > 0) { |
| @@ -27,7 +27,7 @@ main(void) | |||
| 27 | 27 | ||
| 28 | clock_t end = clock(); | 28 | clock_t end = clock(); |
| 29 | 29 | ||
| 30 | printf("Result: %zu, Duration: %.3lf sec\n", sum, (double)(end - start) / CLOCKS_PER_SEC); | 30 | printf("Result: %zu, Duration: %.3lf sec\n", sum, ((double)(end - start)) / CLOCKS_PER_SEC); |
| 31 | 31 | ||
| 32 | return EXIT_SUCCESS; | 32 | return EXIT_SUCCESS; |
| 33 | } | 33 | } |
