Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. timing = Benchmark.measure { Post.all }
  2.  
  3. 2.3.0 :001 > require 'benchmark/ips'
  4. => true
  5. 2.3.0 :002 > Benchmark.ips do |x|
  6. 2.3.0 :003 > x.report("add: ") { 1+2 }
  7. 2.3.0 :004?> x.report("div: ") {1/2}
  8. 2.3.0 :005?> x.report("iis: ") {1/2.0}
  9. 2.3.0 :006?> end
  10. Warming up --------------------------------------
  11. add: 280.299k i/100ms
  12. div: 278.189k i/100ms
  13. iis: 266.526k i/100ms
  14. Calculating -------------------------------------
  15. add: 11.381M (± 4.5%) i/s - 56.901M in 5.010669s
  16. div: 9.879M (± 4.6%) i/s - 49.518M in 5.024084s
  17. iis: 9.289M (± 4.2%) i/s - 46.376M in 5.001639s
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement