ruby-changes:1759
From: ko1@a...
Date: 25 Aug 2007 00:52:32 +0900
Subject: [ruby-changes:1759] ko1 - Ruby:r13250 (trunk): * benchmark/bm_loop_generator.rb: added.
ko1 2007-08-25 00:51:33 +0900 (Sat, 25 Aug 2007) New Revision: 13250 Added files: trunk/benchmark/bm_loop_generator.rb Modified files: trunk/ChangeLog Log: * benchmark/bm_loop_generator.rb: added. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=13250&r2=13249 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/benchmark/bm_loop_generator.rb?revision=13250&view=markup Index: ChangeLog =================================================================== --- ChangeLog (revision 13249) +++ ChangeLog (revision 13250) @@ -1,3 +1,7 @@ +Sat Aug 25 00:49:44 2007 Koichi Sasada <ko1@a...> + + * benchmark/bm_loop_generator.rb: added. + Sat Aug 25 00:22:31 2007 Koichi Sasada <ko1@a...> * prelude.rb: added. run this script on startup. Index: benchmark/bm_loop_generator.rb =================================================================== --- benchmark/bm_loop_generator.rb (revision 0) +++ benchmark/bm_loop_generator.rb (revision 13250) @@ -0,0 +1,14 @@ +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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml