Class: Facter::Framework::Benchmarking::Timer
- Inherits:
-
Object
- Object
- Facter::Framework::Benchmarking::Timer
- Defined in:
- lib/facter/framework/benchmarking/timer.rb
Class Method Summary collapse
Class Method Details
.measure(fact_name, prefix_message = '', &block) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/facter/framework/benchmarking/timer.rb', line 10 def measure(fact_name, = '', &block) if Options[:timing] time = Benchmark.measure(&block) log = "fact '#{fact_name}', took: #{time.format('%r')} seconds" = "#{} " unless .empty? puts "#{}#{log}" else yield end end |