Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'benchmark'
- hash = { a: 1, b: 2 }
- puts "Ruby 2.5 Benchmarks"
- puts ".map() method", Benchmark.measure{ hash.map { |k| k.to_s } }
- puts "New .transform_keys() method", Benchmark.measure{ hash.transform_keys { |k| k.to_s } }
Add Comment
Please, Sign In to add comment