mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
10 lines
191 B
Ruby
10 lines
191 B
Ruby
|
# based on benchmark for [ruby-core:65518] [Feature #10341] by Knut Franke
|
||
|
fib = Fiber.new do
|
||
|
loop { Fiber.yield }
|
||
|
end
|
||
|
i = 0
|
||
|
while i< 6_000_000 # benchmark loop 2
|
||
|
i += 1
|
||
|
fib.resume
|
||
|
end
|