Skip to content

Instantly share code, notes, and snippets.

@davidvandusen
Forked from kvirani/README.md
Created May 5, 2015 14:34
Show Gist options
  • Save davidvandusen/5d4f4e89ef2c09294c5c to your computer and use it in GitHub Desktop.
Save davidvandusen/5d4f4e89ef2c09294c5c to your computer and use it in GitHub Desktop.
def benchmark
# Your benchmarking code goes here.
end
# Be careful, pasting this into IRB will take a long time to print.
# It's a loooong string. :)
long_string = "apple"*100000000
running_time = benchmark { long_string.reverse }
puts "string.reverse took #{running_time} seconds to run"
@moon-choi
Copy link

moon-choi commented May 29, 2022

@ThnxZiggy I think you should add a comment within your own gist bro!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment