Skip to content

Instantly share code, notes, and snippets.

@codesoda
Created July 9, 2012 12:19
Show Gist options
  • Save codesoda/3076151 to your computer and use it in GitHub Desktop.
Save codesoda/3076151 to your computer and use it in GitHub Desktop.
Time ruby code in the console
def time_for
started_at = Time.now
yield
elapsed = Time.now - started_at
end
# elapsed = time_for { 5 * i }
# otherwise Benchmark.measure { 5 * i }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment