Module: Benchmark

Defined in:
lib/liquid/benchmark.rb

Instance Method Summary collapse

Instance Method Details

#realtime(&block) ⇒ Object



4
5
6
7
8
# File 'lib/liquid/benchmark.rb', line 4

def realtime(&block)
  t0 = System.nano_time
  yield
  ((System.nano_time - t0).to_f / 1_000_000_000).round(3)
end