Sha256: 8a63203b2f3977d95b7086c34558abf9a63b3adda77743ecbddf6171bec5c8ee

Contents?: true

Size: 274 Bytes

Versions: 100

Compression:

Stored size: 274 Bytes

Contents

# frozen_string_literal: true

require "benchmark"

class << Benchmark
  # Benchmark realtime in milliseconds.
  #
  #   Benchmark.realtime { User.all }
  #   # => 8.0e-05
  #
  #   Benchmark.ms { User.all }
  #   # => 0.074
  def ms
    1000 * realtime { yield }
  end
end

Version data entries

100 entries across 91 versions & 12 rubygems

Version Path
activesupport-6.0.4.1 lib/active_support/core_ext/benchmark.rb
mumukit-content-type-1.11.1 vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.4/lib/active_support/core_ext/benchmark.rb
activesupport-6.0.4 lib/active_support/core_ext/benchmark.rb
activesupport-5.2.6 lib/active_support/core_ext/benchmark.rb
activesupport-6.0.3.7 lib/active_support/core_ext/benchmark.rb
activesupport-5.2.4.6 lib/active_support/core_ext/benchmark.rb
activesupport-6.0.3.6 lib/active_support/core_ext/benchmark.rb
activesupport-5.2.5 lib/active_support/core_ext/benchmark.rb
activesupport-6.0.3.5 lib/active_support/core_ext/benchmark.rb
activesupport-5.2.4.5 lib/active_support/core_ext/benchmark.rb
activesupport-6.0.3.4 lib/active_support/core_ext/benchmark.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.4.1/lib/active_support/core_ext/benchmark.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.3.2/lib/active_support/core_ext/benchmark.rb
activesupport-5.2.4.4 lib/active_support/core_ext/benchmark.rb
activesupport-6.0.3.3 lib/active_support/core_ext/benchmark.rb
activesupport-6.0.3.2 lib/active_support/core_ext/benchmark.rb
activesupport-6.0.3.1 lib/active_support/core_ext/benchmark.rb
activesupport-5.2.4.3 lib/active_support/core_ext/benchmark.rb
activesupport-6.0.3 lib/active_support/core_ext/benchmark.rb
activesupport-6.0.3.rc1 lib/active_support/core_ext/benchmark.rb