Sha256: 9be0f6c9a4078ba38c6c809d58e4e76c056442e023f8c5b44dd75f194a4f0642

Contents?: true

Size: 243 Bytes

Versions: 23

Compression:

Stored size: 243 Bytes

Contents

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

23 entries across 23 versions & 3 rubygems

Version Path
activesupport-5.1.7 lib/active_support/core_ext/benchmark.rb
activesupport-5.1.7.rc1 lib/active_support/core_ext/benchmark.rb
activesupport-5.1.6.2 lib/active_support/core_ext/benchmark.rb
activesupport-5.1.6.1 lib/active_support/core_ext/benchmark.rb
activesupport-5.1.6 lib/active_support/core_ext/benchmark.rb
tdiary-5.0.8 vendor/bundle/gems/activesupport-5.1.5/lib/active_support/core_ext/benchmark.rb
activesupport-5.1.5 lib/active_support/core_ext/benchmark.rb
activesupport-5.1.5.rc1 lib/active_support/core_ext/benchmark.rb
pract6-0.1.0 .gem/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/core_ext/benchmark.rb
activesupport-5.1.4 lib/active_support/core_ext/benchmark.rb
activesupport-5.1.4.rc1 lib/active_support/core_ext/benchmark.rb
activesupport-5.1.3 lib/active_support/core_ext/benchmark.rb
activesupport-5.1.3.rc3 lib/active_support/core_ext/benchmark.rb
activesupport-5.1.3.rc2 lib/active_support/core_ext/benchmark.rb
activesupport-5.1.3.rc1 lib/active_support/core_ext/benchmark.rb
tdiary-5.0.5 vendor/bundle/gems/activesupport-5.1.2/lib/active_support/core_ext/benchmark.rb
activesupport-5.1.2 lib/active_support/core_ext/benchmark.rb
activesupport-5.1.2.rc1 lib/active_support/core_ext/benchmark.rb
activesupport-5.1.1 lib/active_support/core_ext/benchmark.rb
activesupport-5.1.0 lib/active_support/core_ext/benchmark.rb