~ubuntu-branches/ubuntu/intrepid/ruby1.9/intrepid-updates

« back to all changes in this revision

Viewing changes to benchmark/bm_loop_generator.rb

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-09-04 16:01:17 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20070904160117-i15zckg2nhxe9fyw
Tags: 1.9.0+20070830-2ubuntu1
* Sync from Debian; remaining changes:
  - Add -g to CFLAGS.
* Fixes build failure on ia64.
* Fixes build failure with gcc-4.2 on lpia.
* Robustify check for target_os, fixing build failure on lpia.
* Set Ubuntu maintainer address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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