From e946c5853b99607cc5fe92225c473a51ecc44e99 Mon Sep 17 00:00:00 2001 From: Francesco Rodriguez Date: Thu, 4 Apr 2013 17:39:00 -0500 Subject: add documentation to Benchmark#ms [ci skip] --- activesupport/lib/active_support/core_ext/benchmark.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'activesupport/lib') diff --git a/activesupport/lib/active_support/core_ext/benchmark.rb b/activesupport/lib/active_support/core_ext/benchmark.rb index 2d110155a5..eb25b2bc44 100644 --- a/activesupport/lib/active_support/core_ext/benchmark.rb +++ b/activesupport/lib/active_support/core_ext/benchmark.rb @@ -1,6 +1,13 @@ require 'benchmark' class << Benchmark + # Benchmark realtime in milliseconds. + # + # Benchmark.realtime { User.all } + # # => 8.0e-05 + # + # Benchmark.ms { User.all } + # # => 0.074 def ms 1000 * realtime { yield } end -- cgit v1.2.3