Class: VagrantPlugins::ProviderLibvirt::Util::Timer

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-libvirt/util/timer.rb

Class Method Summary collapse

Class Method Details

.timeObject

A basic utility method that times the execution of the given block and returns it.



9
10
11
12
13
14
15
# File 'lib/vagrant-libvirt/util/timer.rb', line 9

def self.time
  start_time = Time.now.to_f
  yield
  end_time = Time.now.to_f

  end_time - start_time
end