Sha256: bed7373d160051fab41a3475af145090b9066c507cf8aeca90726841593c3c47

Contents?: true

Size: 389 Bytes

Versions: 6

Compression:

Stored size: 389 Bytes

Contents

# frozen_string_literal: true

module VagrantPlugins
  module Packet
    module Util
      class Timer
        # A basic utility method that times the execution of the given
        # block and returns it.
        def self.time
          start_time = Time.now.to_f
          yield
          end_time = Time.now.to_f

          end_time - start_time
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
vagrant-packet-0.1.6 lib/vagrant-packet/util/timer.rb
vagrant-packet-0.1.5 lib/vagrant-packet/util/timer.rb
vagrant-packet-0.1.4 lib/vagrant-packet/util/timer.rb
vagrant-packet-0.1.3 lib/vagrant-packet/util/timer.rb
vagrant-packet-0.1.2 lib/vagrant-packet/util/timer.rb
vagrant-packet-0.1.1 lib/vagrant-packet/util/timer.rb