Created
October 28, 2013 01:38
-
-
Save scarfacedeb/7190139 to your computer and use it in GitHub Desktop.
Helper to measure execution time
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author: Ryan Bates | |
# see: https://github.com/railscasts/137-memoization-revised/blob/master/store-after/app/helpers/application_helper.rb | |
def report_time(code) | |
start = Time.now | |
result = eval(code) | |
finish = Time.now | |
render "report", code: code, result: result, time: finish - start | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment