7 KSTREAM_INIT(int, read
, 4096)
11 int main(int argc
, char *argv
[])
15 fprintf(stderr
, "Usage: %s <in.txt>\n", argv
[0]);
23 fp
= fopen(argv
[1], "r");
24 while (fgets(s
, BUF_SIZE
, fp
));
26 fprintf(stderr
, "[fgets] %.2f sec\n", (float)(clock() - t
) / CLOCKS_PER_SEC
);
33 s
.l
= s
.m
= 0; s
.s
= 0;
34 fd
= open(argv
[1], O_RDONLY
);
36 while (ks_getuntil(ks
, '\n', &s
, &dret
) >= 0);
40 fprintf(stderr
, "[kstream] %.2f sec\n", (float)(clock() - t
) / CLOCKS_PER_SEC
);