Class: Benchmark

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.msObject



41
42
43
# File 'lib/core_ext.rb', line 41

def ms
  1000 * realtime { yield }
end

Instance Method Details

#realtimeObject



33
34
35
36
37
38
# File 'lib/core_ext.rb', line 33

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