Guest User

Untitled

a guest
Jan 16th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. require 'benchmark'
  2.  
  3. hash = { a: 1, b: 2 }
  4.  
  5. puts "Ruby 2.5 Benchmarks"
  6. puts ".map() method", Benchmark.measure{ hash.map { |k| k.to_s } }
  7. puts "New .transform_keys() method", Benchmark.measure{ hash.transform_keys { |k| k.to_s } }
Add Comment
Please, Sign In to add comment