Sha256: 9dca69b06c76c03b9ad0eb4b6f5b41b25762fa8e1a44ae5a464ee3702c6a3d47

Contents?: true

Size: 449 Bytes

Versions: 3

Compression:

Stored size: 449 Bytes

Contents

# frozen_string_literal: true

module VagrantPlugins
  module ProviderLocal
    module Util
      # This is a utlity to time commands and scripts
      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

3 entries across 3 versions & 1 rubygems

Version Path
vagrant-local-0.0.3 lib/vagrant-local/util/timer.rb
vagrant-local-0.0.2 lib/vagrant-local/util/timer.rb
vagrant-local-0.0.1 lib/vagrant-local/util/timer.rb