mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
15 lines
183 B
Ruby
15 lines
183 B
Ruby
|
max = 600000
|
||
|
|
||
|
if defined? Fiber
|
||
|
gen = (1..max).each
|
||
|
loop do
|
||
|
gen.next
|
||
|
end
|
||
|
else
|
||
|
require 'generator'
|
||
|
gen = Generator.new((0..max))
|
||
|
while gen.next?
|
||
|
gen.next
|
||
|
end
|
||
|
end
|