Profiling Your Application : profile « Development « Ruby






Profiling Your Application



#!/usr/bin/env ruby

require 'profile'

total = 0
('a'..'zz').each do |seq|
  ['a', 'b', 'c'].each do |i|
    if seq.index(i)
      total += 1
      break
    end
  end
end
puts "Total: #{total}"

 








Related examples in the same category

1.Ruby profiler: add require "profile" to the start of your code