mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
16 lines
186 B
Ruby
16 lines
186 B
Ruby
|
#
|
||
|
# Seek and Read file.
|
||
|
#
|
||
|
|
||
|
require 'tempfile'
|
||
|
|
||
|
max = 20_000
|
||
|
str = "Hello world! " * 1000
|
||
|
f = Tempfile.new('yarv-benchmark')
|
||
|
f.write str
|
||
|
|
||
|
max.times{
|
||
|
f.seek 0
|
||
|
f.read
|
||
|
}
|