How can i measure the time taken by a method and the individual statements in that method in Ruby. If you see the below method i want to measure the total time taken by the meth
You could use the Time object. (Time Docs)
Time
For example,
start = Time.now # code to time finish = Time.now diff = finish - start
diff would be in seconds, as a floating point number.
diff
EDIT: end is reserved.
end