Guest User

perf_solu_final

a guest
Jun 23rd, 2014
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.12 KB | None | 0 0
  1. def measure n=1
  2.   pre = Time.now.to_f
  3.   n.times do
  4.     yield
  5.   end
  6.   post = Time.now.to_f
  7.   (post - pre) / n
  8. end
Advertisement
Add Comment
Please, Sign In to add comment