Advertisement
Azure

timedrequire

Jul 9th, 2011
375
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.24 KB | None | 0 0
  1. STDOUT.sync = true
  2. module TimedRequire
  3.   def require(*args)
  4.     time = Time.now
  5.     super
  6.     print "require '#{args.join(",")}': %.08f %s\n" % [(Time.now - time), ("* slowdown" if (Time.now - time) >= 0.01)]
  7.   end
  8. end
  9.  
  10. include TimedRequire
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement