Skip to content

Instantly share code, notes, and snippets.

@googya
Created January 16, 2013 12:46
Show Gist options
  • Select an option

  • Save googya/4546900 to your computer and use it in GitHub Desktop.

Select an option

Save googya/4546900 to your computer and use it in GitHub Desktop.
profile_tool
def profile_tool(msg, &block)
start_time = Time.now
res = block.call
end_time = Time.now
elapsed = (end_time - start_time).to_f * 1000
Rails.logger.debug "profile #{msg}, #{elapsed}"
res
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment