class Rake::Funnel::Support::Timing::Statistics
Attributes
started_at[R]
Public Class Methods
new()
click to toggle source
# File lib/rake/funnel/support/timing/statistics.rb, line 12 def initialize @stats = [] @started_at = Time.now end
Public Instance Methods
benchmark(task) { || ... }
click to toggle source
# File lib/rake/funnel/support/timing/statistics.rb, line 21 def benchmark(task) t0 = Time.now begin yield if block_given? ensure t1 = Time.now @stats << { task: task, time: t1 - t0 } end end
each(&block)
click to toggle source
# File lib/rake/funnel/support/timing/statistics.rb, line 17 def each(&block) @stats.each(&block) end