Class: Benchmark

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.msObject



16
17
18
# File 'lib/active_support/core_ext/benchmark.rb', line 16

def ms
  1000 * realtime { yield }
end

Instance Method Details

#realtimeObject



8
9
10
11
12
13
# File 'lib/active_support/core_ext/benchmark.rb', line 8

def realtime
  r0 = Time.now
  yield
  r1 = Time.now
  r1.to_f - r0.to_f
end