daily pastebin goal
75%
SHARE
TWEET

Untitled

a guest Mar 8th, 2018 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def duration_of
  2.   return 0 unless block_given?
  3.   yield start = Time.now
  4. ensure
  5.   Time.now - start
  6. end
  7.  
  8. x = duration_of {
  9.   sleep 0.1
  10.   raise "foo"
  11. }
  12.  
  13. p x
  14.  
  15. puts "at the end"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top