performance - timing code in ruby/rails -
i have rake task/batch job taking long , im trying track down in production time being spent. have started adding:
start_time = time.now # logic end_time = time.now elapsed_time = end_time - start_time puts "elapsed time #{elapsed_time} logic"
is best way this? dont want install external tools in production. need finer grained timings method levels, because need know data being used each method/section etc.
i think you'll bang buck using profiler (like ruby-prof). show time being spent.
Comments
Post a Comment