Sha256: 603b768be48bd7513b61f52898308728d86d19929908386452b199809c20d750
Contents?: true
Size: 463 Bytes
Versions: 5
Compression:
Stored size: 463 Bytes
Contents
module Rake::Funnel::Support::Timing class Statistics include Enumerable attr_reader :started_at def initialize @stats = [] @started_at = Time.now end def each(&block) @stats.each(&block) end def benchmark(task) t0 = Time.now begin yield if block_given? ensure t1 = Time.now @stats << { task: task, time: t1 - t0 } end end end end
Version data entries
5 entries across 5 versions & 1 rubygems