diff options
| author | Thomas Schmucker <ts@its1.de> | 2020-06-13 16:27:06 +0200 |
|---|---|---|
| committer | Thomas Schmucker <ts@its1.de> | 2020-06-13 16:27:06 +0200 |
| commit | 3ddc8646784055b02ed89dfc5166d7d90fb19aa3 (patch) | |
| tree | 0281698bed7f1a603876dd55ffdcc2076a632d8b /seq-read.c | |
| parent | a48204361fad20402f2e54ea829227fb3d5fa10a (diff) | |
| download | libcsv-3ddc8646784055b02ed89dfc5166d7d90fb19aa3.tar.gz libcsv-3ddc8646784055b02ed89dfc5166d7d90fb19aa3.tar.bz2 libcsv-3ddc8646784055b02ed89dfc5166d7d90fb19aa3.zip | |
update seq-read.c
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 | } |
