Benchmark

module Benchmark

Public Class Methods

ms() { || ... } Show source

Benchmark realtime in milliseconds.

Benchmark.realtime { User.all }
# => 8.0e-05

Benchmark.ms { User.all }
# => 0.074
# File activesupport/lib/active_support/core_ext/benchmark.rb, line 11
def ms
  1000 * realtime { yield }
end

© 2004–2016 David Heinemeier Hansson
Licensed under the MIT License.

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部