timer.rb

Path: lib/rubygems/timer.rb
Last Update: Tue Dec 12 19:59:59 +0000 2006

This file defines a $log variable for logging, and a time() method for recording timing information.

Methods

time  

Public Instance methods

[Source]

    # File lib/rubygems/timer.rb, line 17
17: def  timetime(msg, width=25)
18:   t = Time.now
19:   return_value = yield
20:   elapsed = Time.now.to_f - t.to_f
21:   elapsed = sprintf("%3.3f", elapsed)
22:   $log.debug "#{msg.ljust(width)}: #{elapsed}s"
23:   return_value
24: end

[Validate]