End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
Gem.time
time(msg, width = 0, display = Gem.configuration.verbose) { || ... }
lib/rubygems.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.2.0/lib/rubygems.rb, line 961
def self.time(msg, width = 0, display = Gem.configuration.verbose)
now = Time.now
value = yield
elapsed = Time.now - now
ui.say "%2$*1$s: %3$3.3fs" % [-width, msg, elapsed] if display
value
end
Prints the amount of time the supplied block takes to run using the debug UI output.