Class: Benchmark

Inherits:
Object show all
Defined in:
lib/active_support/core_ext/benchmark.rb

Class Method Summary collapse

Class Method Details

.ms โ‡’ Object

Benchmark realtime in milliseconds.

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

Benchmark.ms { User.all }
# => 0.074
[View source]

13
14
15
# File 'lib/active_support/core_ext/benchmark.rb', line 13

def ms
  1000 * realtime { yield }
end