Sha256: 90fe17a975586ae42095f59cbd143a67a54046aab00336e71d931b66058ef13a
Contents?: true
Size: 596 Bytes
Versions: 34
Compression:
Stored size: 596 Bytes
Contents
# frozen_string_literal: true require 'benchmark' module Facter module Framework module Benchmarking class Timer class << self def measure(fact_name, prefix_message = '') if Options[:timing] time = Benchmark.measure { yield } log = "fact '#{fact_name}', took: #{time.format('%r')} seconds" prefix_message = "#{prefix_message} " unless prefix_message.empty? puts "#{prefix_message}#{log}" else yield end end end end end end end
Version data entries
34 entries across 34 versions & 1 rubygems