Benchmark and measure execution time your Ruby methods without an
additional code changes:
Please put a star if you like it!
Thank you! Your feedback is appreciated.
Sample:
class User < ActiveRecord::Base
include BenchmarkMethods
benchmark :generate_report
cbenchmark :import_users
def generate_report
report = reports.create(name: ‘My Report’)
report.add_db_data
report.generate
report
end
def self.import_users(csv)
CSV.parse(csv) do |row|
process_import_user(row)
end
end
end