Sha256: d7e8b71dcb123312b8a2e42a73421ee80116175fb0be6c83f08cd6d62ca518f4

Contents?: true

Size: 649 Bytes

Versions: 4

Compression:

Stored size: 649 Bytes

Contents

#!/usr/bin/env ruby
# encoding: UTF-8

require File.expand_path('../test_helper', __FILE__)

def slow
  sleep(3)
end

def fast
  sleep(3)
end

def slow_caller
  1.times do
    slow
  end
end

def fast_caller
  1.times do
    fast
  end
end

def parent
  [1..10].each do
  #slow_caller
  fast_caller
    end
end

class SummarizeTest < Test::Unit::TestCase
  def setup
    # Need to use wall time for this test due to the sleep calls
    RubyProf::measure_mode = RubyProf::WALL_TIME
  end

  def test
    result = RubyProf::Profile.profile do
      parent
    end

    printer = RubyProf::GraphPrinter.new(result)
    printer.print(STDOUT)

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruby-prof-0.11.0.rc3-x86-mingw32 test/summarize_test.rb
ruby-prof-0.11.0.rc3 test/summarize_test.rb
ruby-prof-0.11.0.rc2-x86-mingw32 test/summarize_test.rb
ruby-prof-0.11.0.rc2 test/summarize_test.rb