Skip to content

Instantly share code, notes, and snippets.

@dsabanin
Created January 10, 2013 15:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dsabanin/4503086 to your computer and use it in GitHub Desktop.
Save dsabanin/4503086 to your computer and use it in GitHub Desktop.
def benchmark(name, &blk)
t1 = Time.now
ret = blk.call
time = Time.now - t1
$STATSD.timing(name, time)
[ret, time]
end
retvalue, time = benchmark("svn-commit-time") do
`svn command blah`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment