Class: Benchmark

Inherits:
Object show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.4/lib/active_support/core_ext/benchmark.rb

Class Method Summary collapse

Class Method Details

.ms(&block) ⇒ Object

Benchmark realtime in milliseconds.

Benchmark.realtime { User.all }
# => 8.0e-05

Benchmark.ms { User.all }
# => 0.074


13
14
15
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.4/lib/active_support/core_ext/benchmark.rb', line 13

def ms(&block)
  1000 * realtime(&block)
end