repo.or.cz
/
ruby-svn.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
add rdoc.
[ruby-svn.git]
/
benchmark
/
bm_loop_generator.rb
blob
d3375c744c94462a073bae3dc702b8e2c5132f5a
1
max = 600000
2
3
if defined? Fiber
4
gen = (1..max).each
5
loop do
6
gen.next
7
end
8
else
9
require 'generator'
10
gen = Generator.new((0..max))
11
while gen.next?
12
gen.next
13
end
14
end