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 = '') ⇒ 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, = '') if Options[:timing] time = Benchmark.measure { yield } log = "fact '#{fact_name}', took: #{time.format('%r')} seconds" = "#{} " unless .empty? puts "#{}#{log}" else yield end end |