diff options
author | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2013-04-04 17:39:00 -0500 |
---|---|---|
committer | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2013-04-04 17:39:00 -0500 |
commit | e946c5853b99607cc5fe92225c473a51ecc44e99 (patch) | |
tree | 36c3c7bc98445794243931ce8a19ee424e9bbc4d /activesupport/lib/active_support | |
parent | 7755ae7ba6d64207892f079587e0d6e56396c809 (diff) | |
download | rails-e946c5853b99607cc5fe92225c473a51ecc44e99.tar.gz rails-e946c5853b99607cc5fe92225c473a51ecc44e99.tar.bz2 rails-e946c5853b99607cc5fe92225c473a51ecc44e99.zip |
add documentation to Benchmark#ms [ci skip]
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/core_ext/benchmark.rb | 7 |
1 files changed, 7 insertions, 0 deletions
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 |