Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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