Last active
July 4, 2016 15:23
-
-
Save buraksay/d7e96fc7f39951e4a7e56493ac0c58d0 to your computer and use it in GitHub Desktop.
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
def elapsed_time(method=nil, *args) | |
beginning_time = Time.now | |
if block_given? | |
yield | |
else | |
self.send(method, args) | |
end | |
end_time = Time.now | |
puts "Time elapsed #{(end_time - beginning_time)*1000} milliseconds" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment