factor/extra/benchmark/sum-file/sum-file.factor

15 lines
353 B
Factor

USING: io io.files math math.parser kernel prettyprint
benchmark.random io.encodings.ascii ;
IN: benchmark.sum-file
: sum-file-loop ( n -- n' )
readln [ string>number + sum-file-loop ] when* ;
: sum-file ( file -- )
ascii [ 0 sum-file-loop ] with-file-reader . ;
: sum-file-main ( -- )
random-numbers-path sum-file ;
MAIN: sum-file-main